class Solution:
# @param {integer[]} nums
# @return {integer}
def removeDuplicates(self, nums):
if len(nums) == 0:
return 0
if len(nums) == 1:
return 1
curVal = nums[0]
curPos = 0
noRepLen = 1
for i in range(1,len(nums)):
if nums[i] == curVal:
continue
else:
noRepLen+=1
curVal = nums[i]
nums[curPos+1] = nums[i]
curPos+=1
return noRepLen