Missing Numbers
Every value in nums is a whole number from 0 to n - 1 (repeats are possible). Return a sorted list of the numbers from 0 to n - 1 that do not appear in nums. Return an empty list if none are missing.
Example 1
nums [0,2,2,5]
n 6
returns [1,3,4]
The numbers 1, 3 and 4 never appear.
Constraints
1 <= n <= 301 <= len(nums) <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Most Common ValueEasy
- Most Different PositionEasy
- Outlier CountEasy
- Pair DifferencesEasy
- Percent ChangeEasy
- Row RangesEasy
- Rows With a ZeroEasy
- Rows of WidthEasy