```
// This is classical interview question
// As we know, the same number XOR together will be 0,
// So, XOR all of numbers, the result is the number which only appears once.
int s = 0;
for (auto it = nums.begin(); it != nums.end(); it++)
{
s ^= *it;
}
return s;
```