```
/*
* Each bit in y2 y1 is such that:
* y2 y1 ::= 00 -> 01 -> 11 -> 00
*/
int singleNumber(int *nums, int numsSize)
{
int y2 = 0, y1 = 0, t2, t1;
while (--numsSize >= 0) {
t2 = nums[numsSize] & y1;
t1 = nums[numsSize] & ((~y2 & ~y1) | y2);
y2 ^= t2;
y1 ^= t1;
}
return y1;
}
```