Find All Numbers Disappeared
Easy
Arrays
Array
Hash Table
Given array of n integers in [1,n], find numbers that don't appear. Space-separated.
Constraints
n = nums.length ≤ 10^5
Examples
Example 1:
Input: 4 3 2 7 8 2 3 1
Output: 5 6
Example 2:
Input: 1 1
Output: 2
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console