Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- int singleNumber(vector<int>& nums) {
- int singleNum = 0;
- for(auto x : nums) singleNum ^= x;
- return singleNum;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement