Smallest missing positive integer in O(n) time and O(1) space
Filed under Dunzo
The question
Given an unsorted integer array, find the smallest missing positive integer. The algorithm must run in O(n) time and use O(1) auxiliary space.
No write-up yet. Related questions below have one.
Related Dunzo questions
Collected from public candidate posts and coding forums. Updated Nov 2026.