Find All Numbers Disappeared in an Array

Given an array of n integers where each integer is in the range [1, n], find all the missing numbers in this range that are not present in the array.

Constraints

  • n == nums.length
  • 1 <= n <= 10^5
  • 1 <= nums[i] <= n
Saving… · 2 lines
class Solution:
def findDisappearedNumbers(self, nums: List[int]) -> List[int]:
Console

Click Run to execute sample tests.