FunctionRacerProblemsRace

Maximum XOR of Two Numbers

EasyBitsPython, JavaScript, TypeScript, Java, C++

Return the largest value of nums[i] ^ nums[j] (bitwise XOR) over all pairs of positions i and j. The two positions may be equal, which gives 0.

Example 1

nums [3,10,5,25,2,8]
returns 28

5 ^ 25 = 28.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Bits problems