#C9378. Missing Positive Integer

    ID: 53464 Type: Default 1000ms 256MiB

Missing Positive Integer

Missing Positive Integer

Given an unsorted array of integers, find the smallest positive integer that is missing from the array.

You are provided with an array of size n. Your task is to find the smallest positive integer (greater than 0) that does not appear in the array.

Example 1:

Input: n = 5, arr = [0, -10, 1, 3, -20]
Output: 2

Example 2:

Input: n = 3, arr = [1, 2, 3]
Output: 4

Note: The input is read from standard input and the result should be printed to standard output.

inputFormat

The first line of input contains an integer n denoting the number of elements in the array.

The second line contains n space-separated integers representing the elements of the array.

outputFormat

Output a single integer which is the smallest positive missing number.

## sample
5
0 -10 1 3 -20
2

</p>