I could not understand the problem, please explain to me the
problem with some more examples.
XOR Profit Problem
you have been given two integers x and y. You need to find two integers between x and y(inclusive)
such that the xor of the two integers selected is maximum.
Example: x=5 and y=10 then if you select l=5 and r=10 then the xor(=15) is maximum.
Can you pls elaborate your approach.
I have done this problem in O(n*n) is there any other better approch
Yes you can solve this problem in O(logn). try to think of approach if you take xor of a and b, then what should be the max xor??