Find the minimal positive integer not occurring in a given sequence
Given a non-empty zero-indexed array A of N integers, returns the minimal positive integer (greater than 0) that does not occur in A.
Assume that:
N is an integer within the range [1..100,000]; each element of array A is an integer within the range [โ2,147,483,648..2,147,483,647]. Complexity:
expected worst-case time complexity is O(N); expected worst-case space complexity is O(N), beyond input storage (not counting the storage required for input arguments).
Codility
Complexity: O(n) Correctness: 100% Performance: 100%