Simpe C++ CODE RoSh


#1

Comment body goes here.
"
int Solution::power(string A) {
int n = A.size();

long int ans = A[0]-'0';
for(int i = 1; i < n; i++){
    ans = ans*10+(A[i]-'0');
}

if(ans == 1)
return 0;

int x = log(ans)/log(2);

if(pow(2,x) == ans)
return 1;

else return 0;

}

"