Do I need to store bits of a number in an array? and what to do if both no. does not contain same number of bits?
How to approach this problem?
hello @raj.verma5454
A simple solution for this problem is to generate all pairs, find their XOR values and finally return the maximum XOR value.
or u can take help of binary pattern between l and r.
pls refer this article -> https://www.geeksforgeeks.org/maximum-xor-value-of-a-pair-from-a-range/
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.