class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
length = len(nums)
k = 0
if length==0:
return 0
if length == 1:
return 1
fol = nums[0]
for i in range(0,length-1):
if nums[i] == nums[i+1]:
continue
k += 1
nums[k] = nums[i+1]
return k+1