public static int singleNumberByHashSet(int[] A) {
       HashSet<Integer> hSet=new HashSet<>();
       for(int i=0;i<A.length;i++)
       {
    	   if(hSet.contains(A[i]))
    		   hSet.remove(A[i]);
    	   else
    		   hSet.add(A[i]);
       }
       return hSet.iterator().next();
    }