About Xor Profit Problem

Hi , I was trying to write an efficient code of that problem and try to submit on to the codeforces plateform but there is a test case which failed. I was trying but not able to found where the problem . can you help me

Coding block Link->https://ide.codingblocks.com/s/197130

codeforces question-> (D) Little Girl and Maximum XOR
while submit the question it was failed on testcase 11.

All you have to do is take xor of l and r.
Then find the leftmost set bit.
Then for maximum xor of 2 numbers, all you have to do is upto that leftmost bit add the (1<<i) to answer.
Refer this for better understanding -:

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.