def remove_duplicates(nums: [int]) -> int: cnt = 1 for index in range(len(nums) - 1): if nums[index] != nums[index + 1]: nums[cnt] = nums[index + 1] cnt += 1 print(cnt)