How would you find the missing first positive integer in an array?
Implement def first_missing_positive(nums):, returning the smallest positive integer not present in the input array. The solution should run in O(n) time and use O(1) extra space, excluding the input array.
def first_missing_positive(nums):