values in which every value appears exactly twice, except for one value that appears exactly once. Return that lonely value.
Aim for linear time and O(1) extra memory.values=[7, 3, 7] → 3
The 7 shows up twice, while the 3 shows up only once.
values=[-5, 9, 0, 9, 0] → -5
Both 9 and 0 have a twin; -5 does not.
values=[42] → 42
values=[7, 3, 7]
3
Run checks the first 3 tests in your browser. Submit checks all 91 tests on the server, hidden ones included.