class Solution {
public:
int findNumberAppearingOnce(vector<int>& nums) {
int move = 1;
int res = 0;
for(int i = 0; i < 32; i++, move ++){
int cnt = 0;
for(int num : nums)
if((num >> move) & 1) cnt ++;
if(cnt % 3) res |= (1 << move);
}
return res;
}
};