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