i does not understand how can we find a and b?
💡 XOR Profit Problem
@khemchandrs You can make 2 variables a and b.
- Initiate a with x and take it till y incrementing 1 at a time.
- Make another variable b, start it from a and take it till y, again, increasing 1 at a time.
- Find the values of the variables a and b, and keep updating a variable which stores the xor values of a and b whenever you find a maximum value.
- At the end print the value of that variable which was holding the xor values.
Hope this helps.
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.