from typing import List


class Solution:
    def removeDublicates(self, nums: List[int]) -> int:
        counter = 1
        nums_unique_index = 0
        delete_candidates = []
        for i in range(1, len(nums)):
            if nums[i] == nums[nums_unique_index]:
                delete_candidates.append(i)
            else:
                nums_unique_index = i
                counter += 1
        for index in sorted(delete_candidates, reverse=True):
            del nums[index]
        return counter


print(Solution().removeDublicates(nums=[1, 1, 2]))
print(Solution().removeDublicates(nums=[0, 0, 1, 1, 1, 2, 2, 3, 3, 4]))
