HELP to detect the problem with my code

Problem : MAX2 Problem - CodeChef
My submission : CodeChef: Practical coding for everyone

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