Largest XOR of Any Pick
Pick any of the items of nums, from any positions, and XOR (^) them all together. Picking nothing gives 0.
Return the largest result a pick can give.
Example 1
nums [9,5,3]
returns 15
9 ^ 5 ^ 3 = 15, and with four bits nothing is larger.
Example 2
nums [6,6]
returns 6
Picking both gives 6 ^ 6 = 0, so pick just one.
Example 3
nums [0]
returns 0
Everything gives 0.
Constraints
1 <= len(nums) <= 600 <= nums[i] < 2**30
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.