Coding Software Engineer
For an unordered integer array nums, determine the lowest positive integer that is not contained in nums.
The algorithm must complete in O(n) time while using only O(1) additional memory.
Example 1:
Input: nums = [1,3,0]
Output: 2
Explanation:
Since 1 exists but 2 does not, the first positive value absent from the array is 2.
Example 2:
Input: nums = [4,5,-1,1]
Output: 2
Example 3:
Input: nums = [6,8,10]
Output: 1
1 <= nums.length <= 10^5-2^31 <= nums[i] <= 2^31 - 1