Why wrong answer?

hi @raj.verma5454 you’d need nested for loops to make all the possible pairs and check for their XOR but that’d be very inefficient (O(N) complexity) Please refer to the hint video for a more efficient approach

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.

I couldn’t understand this approach . https://www.geeksforgeeks.org/maximum-xor-value-of-a-pair-from-a-range/ Please provide some hint

@raj.verma5454 you can do this question by using simple 2 for loops as constraints less.
for the efficient approach try to read it one more time from the link. they have explained with an example too.
ans will me msb of xor of L and R like 1xxxx al x can be made 1 too

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.