题目描述
blablabla
样例
class Solution {
public:
int findNumberAppearingOnce(vector<int>& nums) {
int count[32] = {0};
for(int i = 0; i < nums.size(); ++i){
for(int j = 0; j < 32; ++j){
if(((nums[i] >> j) & 1) == 1)
count[j]++;
}
}
int ans = 0;
for(int i = 0; i < 32; ++i){
if(count[i] % 3 == 1)
ans += (1<<i);
}
return ans;
}
};