11 lines
260 B
Python
11 lines
260 B
Python
|
class Solution:
|
||
|
def removeDuplicates(self, nums: List[int]) -> int:
|
||
|
k = {}
|
||
|
cnt = 0
|
||
|
for num in nums:
|
||
|
if num not in k:
|
||
|
nums[cnt] = num
|
||
|
cnt += 1
|
||
|
k[num] = 1
|
||
|
return cnt
|