class Solution:
"""
@param: nums: an array of integers
@return: the number of unique integers
"""
def deduplication(self, nums):
new = list()
length = 0
for i in nums:
if i not in new:
new.append(i)
nums[length] = i
length += 1
return length
521. Remove Duplicate Numbers in Array
最新推荐文章于 2021-10-12 12:27:06 发布