In the array nums, exactly two numbers appear only once. Every other number appears exactly twice.
Find the two numbers that appear once. Return them in any order.
Your solution must run in linear time and use only a constant amount of extra space.
Examples
Example 1:
Input: nums = [4,9,4,7]
Output: [7,9]
Explanation: 4 appears twice. 9 and 7 appear once.
Example 2:
Input: nums = [10,-2,3,10,3,6]
Output: [-2,6]
Explanation: 10 and 3 appear twice. -2 and 6 appear once.
Example 3:
Input: nums = [-7,2,5,2]
Output: [5,-7]
Explanation: 2 appears twice. -7 and 5 appear once.