class Solution(object):
    def removeDuplicates(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """

        for i in range(len(nums)):
            for j in range(i+1,len(nums)):
                if nums[i] == nums[i+1]:
                    del nums[i+1]
                else:
                    break


        return len(nums)
Copy the code