同442一样,只是判断条件不一样
class Solution(object):
def findDisappearedNumbers(self, nums):"""
:type nums: List[int]
:rtype: List[int]
"""
f=[0]*(len(nums)+1)
for i in nums:
f[i] +=1
return [i for i,v in enumerate(f) if v<1 and i>0]
同442一样,只是判断条件不一样
class Solution(object):
def findDisappearedNumbers(self, nums):