class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
pos = 0
repeat=0
lastCh=""
for ind, val in enumerate(nums):
if lastCh == val:
repeat+=1
if repeat>1:
continue
else:
lastCh = val
repeat=0
nums[pos]=nums[ind]
pos+=1
del nums[pos:]