Given an unsorted integer array, find the smallest missing positive integer. Cyclic placement is ideal because values in the range 1..n can be positioned by index.
nums = array of integers
smallest missing positive integer
Example 1:
Input:
nums = [1,2,0]
Output:
3
Explanation:
1 and 2 are present, so 3 is the first missing positive.
Example 2:
Input:
nums = [3,4,-1,1]
Output:
2
Explanation:
2 is the smallest positive missing from the array.