I’m sorry but this is totally not acceptable…

what you claim to be your fastest algorithm ( your editorial solution) is also not correct.

public int power(String A)

{

if(A.equals(“1”) || A.equals(“0”))

return 0;

int n=0;

for(int i=0;i<A.length();i++)

{

n=n*10+A.charAt(i)-‘0’;

}

if((n&(n-1))==0)

return 1;

else

return 0;

}

i/p: 604462909807314587353089

o/p: 1

well, the no is odd but your solution successfully proves it even as a power of 2.