TEST CASE "147573952589676412928" not passing


#1

Tried this solution which is working for majority cases, how to debug for passing this test case? :disappointed_relieved: :roll_eyes:

int Solution::power(string A)
{
stringstream ss;
ss<<A;
int a;
ss>>a;
double n=a;
if(a==1)
return 0;
if(a==2)
return 1;
int i=2;
while(n>2)
{
double d=1/(double)i;
n=pow(a,d);
if(pow(round(n),i)==a)
return 1;
i++;
}
return 0;
}


#2

The Number is out of the range of long long!!
max u can check upto INT_MAX by this method