Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. class Solution {
  2. public:
  3.     int singleNumber(vector<int>& nums) {
  4.         int singleNum = 0;
  5.         for(auto x : nums) singleNum ^= x;
  6.         return singleNum;
  7.     }
  8. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement