Guest User

Untitled

a guest
Oct 20th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. int Solution::singleNumber(const vector<int> &A) {
  2. long long ans=0;
  3. vector<int> v=A;
  4. for(int j=0;j<40;++j)
  5. {long long one=0;
  6.  
  7. for(int i=0;i<v.size();++i)
  8. {
  9. if(v[i]%2==1)
  10. one++;
  11. v[i]=v[i]/2;
  12.  
  13. }
  14. if(one%3==1)
  15. ans+=pow(2,j);
  16. }
  17. return ans;
  18. }
Add Comment
Please, Sign In to add comment