SingleNumber II:

class Solution {

public:

int singleNumber(int A[], int n) {

int count[32]={0};

int result;

for(int i=0;i<32;i++)

{

for(int j=0; j<n; j++)

{

**if(abs(A[j]%2)==1)
count[i]++;
A[j]=A[j]/2;**

}

}

for(int i=31;i>=0;i--)

{

result =result*2+count[i]%3;

}

return result;

}

};

Thank you