Login dark

https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/

class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        index = 0
        for k in range(1,len(nums)):
            if nums[k] != nums[k - 1]:
                index += 1
                nums[index] = nums[k]
        return index + 1