Python with 1 pointer Runtime: 119 ms


  • 0
    R

    '''
    i = 0
    while i < len(nums) - 1:
    if nums[i] == nums[i + 1]:
    nums.pop(i)
    else:
    i += 1
    return len(nums)
    '''


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.