illuminati
1 min
Updated: May 29, 2021
Problem: First Missing Integer
Given an unsorted integer array, find the first missing positive integer.
Given [1,2,0] return 3,
[3,4,-1,1] return 2,
[-8, -7, -6] returns 1
Your algorithm should run in O(n) time and use constant space.
Time Complexity: O(N)
Space Complexity: O(N)
Time Complexity: O(NlogN)
Space Complexity: O(1)
Time Complexity: O(N)
Space Complexity: O(1)