Given an array of size n, how do you find the smallest positive integer that is not present in the array?
Implement first_missing_positive(nums), which receives a mutable list of integers and returns the smallest positive integer absent from it. The expected solution should run in O(n) time and use O(1) extra space; modifying nums is allowed.
def first_missing_positive(nums):