You are viewing a single comment's thread. Return to all comments →
def maximizingXor(l, r): msb_position = 0 while l ^ r: msb_position += 1 l >>= 1 r >>= 1 return (1 << msb_position) - 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 →