def removeDuplicates(self, nums):
    (i, ret) = (0, 0)
    for (j, n) in enumerate(nums):
        if ((nums[i] == n) and ((j - i) < 2)):
            ret += 1
        elif (nums[i] != n):
            i = j
            ret += 1
    return ret
def removeDuplicates(self, nums):
    (i, ret) = (0, 0)
    for (j, n) in enumerate(nums):
        if ((nums[i] == n) and ((j - i) < 2)):
            ret += 1
        elif (nums[i] != n):
            i = j
            ret += 1
    return ret