Skip to content

Latest commit

 

History

History

FirstMissingPositive

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

First Missing Positive

Leetcode Link

Problem:

Given an unsorted integer array, find the smallest missing positive integer.

Example:

Input: [1,2,0]
Output: 3
Input: [3,4,-1,1]
Output: 2
Input: [7,8,9,11,12]
Output: 1

Note:

Your algorithm should run in O(n) time and uses constant extra space O(1).