public int singleNumberIII(int[] A)
    {
        if(A == null || A.length % 3 == 0) return Integer.MAX_VALUE;
         Map<Integer,Integer> mm = new HashMap<Integer,Integer>();
         Integer temp;
        for(int i = 0;i<A.length;i++)
        {
            temp = mm.get(A[i]);
            if(temp == null) mm.put(A[i],1);
            else if(++temp<3)
            {
                mm.put(A[i],temp);
            }
            else mm.remove(A[i]);
        }
        return mm.keySet().iterator().next();
    }