645. Set Mismatch
https://leetcode.com/problems/set-mismatch/
Python
class Solution:
def findErrorNums(self, nums: List[int]) -> List[int]:
full_nums = set([n for n in range(1, len(nums)+1)])
missed = full_nums - set(nums)
seen = set()
for num in nums:
if num not in seen:
seen.add(num)
continue
return [num, missed.pop()]