9 lines
263 B
Python
9 lines
263 B
Python
|
class Solution:
|
||
|
def removeDuplicates(self, nums: List[int]) -> int:
|
||
|
current = nums[-1] + 1
|
||
|
for i in range(len(nums)-1, -1, -1):
|
||
|
if nums[i] == current:
|
||
|
del nums[i]
|
||
|
else:
|
||
|
current = nums[i]
|