public int removeDuplicates(int[] A) {
		if(A == null || A.length == 0) return 0;
		int res = 1, base = A[0];
		boolean second = false;
		
		for(int cur = 1; cur < A.length; cur++) {
			if(A[cur] == base) {
				if(!second) second = true;
				else continue;
			} else {
				second = false;
				base = A[cur];
			}
			A[res++] = A[cur];
		}
		return res;
	}