Given an list of integers, return the smallest positive integer not present in the list.
Here is a illustrative example. Consider the list:
[-2, 6, 4, 5, 7, -1, 7, 1, 3, 6, 6, -2, 9, 10, 2, 2]
After reordering (for your benefit), the list becomes:
[-2, -2, -1, 1, 2, 2, 3, 4, 5, 6, 6, 6, 7, 7, 9, 10]
now we see that the smallest missing positive integer is 8.
Examples
(minMiss '(-2 6 4 5 7 -1 1 3 6 -2 9 10 2 2))
> 8
(minMiss '(5 9 -2 0 1 3 9 3 8 9))
> 2
;; Sorting the list we can see the answer is 2 [-2, 0, 1, 3, 3, 5, 8, 9, 9, 9]
(minMiss '(0 4 4 -1 9 4 5 2 10 7 6 3 10 9))
> 1
;; Sorting the list we can see the answer is 1 [-1, 0, 2, 3, 4, 4, 4, 5, 6, 7, 9, 9, 10, 10]
Note: zero (0) is not considered to be a positive number.