Arrays & HashingHard
First Missing Positive
Return the smallest positive whole number that is not in nums. Aim for O(n) time and O(1) extra space.
Example 1nums = [5, 2, -3, 1, 9] → 3
Example 2nums = [1, 2, 3] → 4
1 ≤ n ≤ 10⁵ · −2³¹ ≤ nums[i] < 2³¹