448. Find All Numbers Disappeared in an Array
https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array
Python
class Solution:
def findDisappearedNumbers(self, nums: List[int]) -> List[int]:
n = len(nums)
result = set(range(1, n+1))
for num in nums:
try:
result.remove(num)
except KeyError as err:
pass
return result