class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
index = 0
slow = 0
fast = 0
while fast < len(nums):
while fast < len(nums) and nums[slow] == nums[fast]:
fast += 1
nums[index] = nums[slow]
index += 1
slow = fast
return index
双指针,fast进行判断,slow用于赋值