5m1le

leetcode1

Apr 1st, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. class Solution {    
  2. public:
  3.     int singleNumber(vector<int>& nums) {
  4.         int temp = nums[0];
  5.         for(int i = 1; i < nums.size(); i++) {
  6.             temp ^= nums[i];
  7.             }
  8.         return temp;
  9.         }
  10. };
Add Comment
Please, Sign In to add comment