Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Solution::singleNumber(const vector<int> &A) {
- long long ans=0;
- vector<int> v=A;
- for(int j=0;j<40;++j)
- {long long one=0;
- for(int i=0;i<v.size();++i)
- {
- if(v[i]%2==1)
- one++;
- v[i]=v[i]/2;
- }
- if(one%3==1)
- ans+=pow(2,j);
- }
- return ans;
- }
Add Comment
Please, Sign In to add comment