Every element in the array appears exactly twice, except for one element that appears once. Find that single element.
With nums = [2,2,1]:
- 2 appears twice, 1 appears once.
- Answer: .
With nums = [4,1,2,1,2]:
- 1 appears twice, 2 appears twice, 4 appears once.
- Answer: .
Must use extra space.
Constraints: nums.length .