How do you find the smallest missing positive integer in an unsorted array?
Simple meaning
Place each value v in index v-1 when it lies in 1..n, then scan for the first index i whose value is not i+1.
Open the full page for Why, Steps, Example and Key takeaway.