HELP to detect the problem with my code

Problem : Contest Page | CodeChef
My submission : Solution: 47637452 | CodeChef

I converted the given binary number to decimal the tried to get the max power
but the answer is coming wrong , please tell the corner case I am missing .

Consider the test input:

20
10000000000000000000
1 Like

thanks

1 Like