Sheokand and Number Clarification August_long_Challenge 2018

Can someone suggest whats the problem with my logic for this problem. I believe it’s perfectly fine but don’t know where its lagging resulting in a wrong answer…

I am using logarithmic approach to solve this problem

Problem Link: CodeChef: Practical coding for everyone

https://www.codechef.com/submit/complete/19731276

Regards,
@tushar2899

You have a problem with numbers a little less than a power of two.

For inputs of 31, 59 you should return 2, 6.

1 Like

oh yes. thank you @joffan

@joffan chk the changed one still not working for two