You are given an unsorted integer array nums. Return the smallest positive integer that is not present in nums.
You must implement an algorithm that runs in O(n) time and uses O(1) auxiliary space.
Example 1:
Input: nums = [-2,-1,0]
Output: 1Example 2:
Input: nums = [1,2,4]
Output: 3Example 3:
Input: nums = [1,2,4,5,6,3,1]
Output: 7Constraints:
1 <= nums.length <= 100,000-(2^31) <= nums[i] <= ((2^31)-1)