FunctionRacerProblemsRace

Find Disappeared Numbers

EasyArraysPython, JavaScript, TypeScript, Java, C++

nums has n items and every item is between 1 and n. Some numbers in that range never appear in nums.

Return those missing numbers in increasing order.

Example 1

nums [4,3,2,7,8,2,3,1]
returns [5,6]

5 and 6 never appear.

Example 2

nums [1,1]
returns [2]

n = 2 and 2 is missing.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Arrays problems