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
▲ Console
📱

Install Talent Enrich

Get instant access to jobs and career tools on your device.