```
def removeDuplicates(self, A):
if len(A)==0 or len(A)==1:
return len(A)
i=1
j=1
while i<len(A):
if A[i]!=A[i-1]:
A[j]=A[i]
j=j+1
i=i+1
A[j:]=[]
return j
```

Input: [1,1]

Output: del, pop(), or remove() are not allowed.

Expected: [1]

I did not use del/pop/remove. I just use A[j: ] to shrink the list. Any one knows what's the problem?