Largest XOR of two numbers
Given a list nums of non-negative integers, return the largest value of nums[i] ^ nums[j] (bitwise XOR) over all pairs of positions. Using the same position twice is allowed and gives 0, so a single number returns 0.
Numbers are below 2³¹ and the list has at least one. Aim for O(n · bits), not a check of every pair.
Examples
max_xor([5,1,12,9])→13max_xor([7])→0max_xor([3,8,15,6,10])→14