Given an integer array nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. Return the answer in any order.
nums = [1,2,1,3,2,5][3,5]nums = [3,7,3,4][7,4]All pairs XOR to 0, leaving xor=a^b. Since a≠b, at least one bit differs. We pick the lowest such bit. It splits the array so one group has a (and a's pairs) and the other has b (and b's pairs). XOR within each group cancels the pairs, leaving the unique number.