fix:找到所有数组中消失的数字

上级 aebadef1
"""
找到所有数组中消失的数字
"""
from typing import List
class Solution:
def findDisappearedNumbers(self, nums: List[int]) -> List[int]:
all = set([i + 1 for i in range(len(nums))])
return list(all.difference(set(nums)))
if __name__ == '__main__':
result = Solution().findDisappearedNumbers([4, 3, 2, 7, 8, 2, 3, 1])
print(result)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册