Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
11 lines (11 sloc) 265 Bytes
class Solution {
public:
int singleNumber(vector<int>& nums) {
int xorResult = 0;
for (vector<int>::iterator itr = nums.begin();
itr != nums.end(); ++itr) {
xorResult ^= *itr;
}
return xorResult;
}
};