java 代码
class Solution {
public int findNumberAppearingOnce(int[] nums) {
int len = nums.length;
int[] a = new int[32];
for(int i = 0; i<len; i++){
int j = 0;
int t = nums[i];
while(t!=0){
if((t&1)!=0)
a[j]++;
j++;
t = t >> 1;
}
}
int re = 0;
for(int i = 0; i<32; i++){
a[i] = a[i]%3;
re = re+ a[i]* (int)Math.pow(2, i);
}
return re;
}
}