"""

def removeDuplicates(self, A):

```
temp = {}
i = 0
while i < len(A):
if A[i] in temp and temp[A[i]] >= 2:
A.pop(i)
elif A[i] not in temp:
temp[A[i]] = 1
i += 1
else:
temp[A[i]] += 1
i += 1
return len(A)
```

"""