Problem 41 · Hard

First Missing Positive

Index-as-hash: swap each number to its correct index position, then scan for the first mismatch.

Open the interactive visualisation