# Single Number III

Given an array of numbers 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.

For example:

Given nums = [1, 2, 1, 3, 2, 5], return [3, 5].

Note:
The order of the result is not important. So in the above example, [5, 3] is also correct.
Your algorithm should run in linear runtime complexity. Could you implement it using only constant space complexity?

• 0^a = a
• a^a = 0
• a^b^a = b

t = n1^n2^n3^...^nk,因为中间只有一个single number,所以t中只有一个数不能因为a^a = 0而消除掉。因此t就是这个序列中的single number.

t & (t-1)可以将第一个为1的bit位清0,然后我们再异或上原来的t,我们就可以得到对应的mask了。