public int removeDuplicates(int[] A) {
    	
    	if(A.length == 0) return 0;
    	
    	int count = 1;
    	int prev = A[0];
    	for(int i = 1; i < A.length; i++) {
    		int curt = A[i];
    		if(curt == prev) {
    			continue;
    		} else {
    			A[count++] = curt;
    			prev = curt;
    		}
    	}
    	return count;
    }