Find All Numbers Disappeared in an Array

Easy · Arrays & Strings · about 10 minutes

Asked at Google, Amazon, Microsoft, Bloomberg, Meta.

nums has length n with values in 1..n. Return all values in 1..n that don't appear, in increasing order, using O(n) time and no extra space besides the output.

Related guides