solve(nums) — every value of nums appears twice except one, which appears
once. Return that value in O(n) time and O(1) extra space — no Set, no counting
map.
XOR (^) is the tool: x ^ x = 0, x ^ 0 = x, and XOR is commutative and
associative. XOR every value together and each pair cancels itself, leaving the single one.
Examples
solve([2,2,1]) → 1
solve([4,1,2,1,2]) → 4
solve([-1,-1,-3]) → -3Sample tests