0041. First Missing Positive

Cyclic Sort / Index Mapping — O(n) time, O(1) space

Speed: 5x
Step 0
Press Step or Play to begin
Array State
Ready. Load an array and press Step or Play.
Result will appear here after the algorithm finishes.
Current (i)
Swap target
Correct position
Scanning
Missing found