[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