[LeetCode] Find All Numbers Disappeared in an Array (Python)
2024. 3. 3. 10:49ㆍ자료구조
class Solution:
def findDisappearedNumbers(self, nums: List[int]) -> List[int]:
temp = set(range(1,len(nums)+1))
answer = temp - set(nums)
return answer
'자료구조' 카테고리의 다른 글
[LeetCode] Min Stack (Python) (0) | 2024.03.06 |
---|---|
[LeetCode] Design Circular Queue (Python) (0) | 2024.03.05 |
[LeetCode] Third Maximum Number (Python) (0) | 2024.03.03 |
[LeetCode] Height Checker (Python) (0) | 2024.03.03 |
[LeetCode] Sort Array By Parity (Python) (0) | 2024.02.29 |