Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/DasyDong/developer-roadmap
/ Solution
Class
Solution
code/removeduplicate.py:1–8 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
class
Solution:
2
def
removeDuplicates(self, nums: [int]):
3
if
not nums:
return
[]
4
k = 1
5
for
i in range(1, len(nums)):
6
if
nums[i] != nums[i - 1]:
7
k += 1
8
return
k
9
10
11
print(Solution().removeDuplicates([1,1,2,3,3,3,4,4,5,5]))
Callers
1
removeduplicate.py
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected