Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- """
- @param: nums: An ineger array
- @return: An integer
- """
- def removeDuplicates(self, nums):
- # write your code here
- i = 0
- while i < len(nums)-1:
- if nums[i] == nums[i+1]:
- nums.pop(i)
- else:
- i+=1
- return len(nums)
Add Comment
Please, Sign In to add comment