Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with extra space.
Example: nums = [2,2,1] returns . Example: nums = [4,1,2,1,2] returns .
This problem uses XOR, the exclusive OR operator you learned earlier. Think about XOR's properties before reading the solution.