You are viewing a single comment's thread. Return to all comments →
PYTHON SOLUTION. NOT A ONE LINER. BUT EASY TO UNDERSTAND FOR BEGINEERS LIKE ME ;) def maxXor( l, r):
max_xor = 0
for low in range(l ,r+1):
for high in range(low, r+1): max_xor = max(max_xor, low ^ high)
return max_xor
Maximizing XOR
You are viewing a single comment's thread. Return to all comments →
PYTHON SOLUTION. NOT A ONE LINER. BUT EASY TO UNDERSTAND FOR BEGINEERS LIKE ME ;) def maxXor( l, r):
max_xor = 0
for low in range(l ,r+1):
return max_xor