daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Oct 20th, 2018 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top