Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def removeDuplicates(nums):
- if len(nums) < 2:
- return len(nums)
- slow, fast = 2, 2
- while fast < len(nums):
- if nums[slow - 2] != nums[fast]:
- nums[slow] = nums[fast]
- slow += 1
- fast += 1
- return slow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement