public int removeDuplicates(int[] A) 
    {
        if(A == null)
            return 0;
        if(A.length <= 1)
            return A.length;
        int new_length = A.length;
        for(int i=1;i<new_length;i++)
        {
            if(A[i] == A[i-1])
            {
                this.switch_array(A, i, new_length);
                new_length--;
                i--;
            }    
        }
        return new_length;
    }