public static int singleNumberByHashMap(int[] A) {
	       HashMap<Integer,Integer> hMap=new HashMap<>();
	       for(int i=0;i<A.length;i++)
	       {
	    	   if(hMap.containsKey(A[i])){
	    		   hMap.put(A[i], hMap.get(A[i])+1);
	    		   if(hMap.get(A[i]) == 3)
	    			   hMap.remove(A[i]);
	    	   }   
	    	   else
	    		   hMap.put(A[i],1);
	       }
	       Iterator iter = hMap.entrySet().iterator();
	       Map.Entry entry = (Map.Entry) iter.next();
	       return (int) entry.getKey();
	    }