Skip to main content
First Missing Positive | AlgoCracked
AlgoCracked
ProblemsFirst Missing Positive
Hard38.0% acceptance
ArrayHash Table

First Missing Positive

Given an unsorted integer array nums , return the smallest positive integer (starting from 1) that does not appear in the array. The intended solution runs in O(n) time and uses O(1) extra space. Input format Input is [nums] , a single array, e.g. [[1,2,0]] .

Loading workspace…