public int singleNumber(int[] A) {
		if(A == null || A.length == 0) return 0;
		int res = 0, mark = 0;
		
		while(mark < 32) {
			int count = 0;
			boolean finished = true;
			for(int i = 0; i < A.length; i++) {
				if((A[i] >> mark & 1) == 1) count++;
				if(A[i] >> mark != 0) finished = false;
			}
			if(count % 3 == 1) {
				res += 1 << mark;
			}
			if(finished) break;
			mark++;
		}
		return res;
    }