Return the maximum value of a ^ b over two numbers a and b taken from nums (they can be the same element, so a list with one number gives 0).
The starter code tries every pair. It is correct but too slow for long lists.
Example 1
Input:
max_xor_pair([3, 10, 5, 25, 2, 8])
Output:
28
Example 2
Input:
max_xor_pair([7])
Output:
0
1 <= len(nums) <= 500000 <= nums[i] < 2**30No results yet
Run your code to check it against the examples, or submit to run every test.