:type nums: List[int] :rtype: int
(self, nums)
| 48 | """ |
| 49 | class Solution(object): |
| 50 | def removeDuplicates(self, nums): |
| 51 | """ |
| 52 | :type nums: List[int] |
| 53 | :rtype: int |
| 54 | """ |
| 55 | |
| 56 | if not nums: |
| 57 | return |
| 58 | |
| 59 | length = len(nums)-1 |
| 60 | |
| 61 | one = nums[length] |
| 62 | |
| 63 | remove_index = [] |
| 64 | |
| 65 | for i in range(length-1, -1, -1): |
| 66 | if one == nums[i]: |
| 67 | remove_index.append(i) |
| 68 | continue |
| 69 | one = nums[i] |
| 70 | |
| 71 | for i in remove_index: |
| 72 | nums.pop(i) |