You are viewing a single comment's thread. Return to all comments →
Lots of naive solutions in the comments. Here is a Python solution:
def maximizingXor(l, r): count = 0 while r != l: r >>= 1 l >>= 1 count += 1 return (1 << count) - 1
Seems like cookies are disabled on this browser, please enable them to open this website
Maximizing XOR
You are viewing a single comment's thread. Return to all comments →
Lots of naive solutions in the comments. Here is a Python solution: