Doubt in Incredible hulk problem

According to the given explanation, I’ve tried this - https://ide.codingblocks.com/s/364487

But all the test cases are getting failed. Please help me out.

hello @gambhirrahul0 do you know the concept of bits manipulation ?
in this question that concept will be used .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.