public int removeDuplicates(int[] A) {
		if(A==null) return 0;
		if(A.length<=2) return A.length;
		
		int offset=2;
		for(int i=2;i<A.length;i++){
			if(A[i]!=A[offset-1] || A[i]!=A[offset-2]){
				A[offset++]=A[i];
			}
		}
		return offset;

	}