public int singleNumber(int[] A) {
        int x = 0;
        int result = 0;
        for (int i = 0;i < 32 ; i++ ){
            x = 0;
            for (int j = 0;j < A.length;j++) {
                if( (A[j] & (1 << i)) != 0)
                    x ++;
            }
            result  = result |((x%3)<<(i));
        }
        return result;
    }