#K13881. Find the Smallest Missing Confirmation Number

    ID: 24011 Type: Default 1000ms 256MiB

Find the Smallest Missing Confirmation Number

Find the Smallest Missing Confirmation Number

You are given a list of confirmation numbers. The task is to determine the smallest missing confirmation number in the list. Formally, given an integer \( n \) and a sequence of \( n \) confirmation numbers, you are to find the smallest positive integer \( x \) that is not present in the sequence.

For example, if \( n=5 \) and the confirmation numbers are [1, 2, 4, 5, 6], then the answer is \( 3 \) because 3 is the smallest positive integer missing from the list.

If all integers from \( 1 \) to \( n \) are present, then the answer will be \( n+1 \). Your solution should handle multiple test cases.

inputFormat

The input is read from standard input (stdin) and is structured as follows:

  • The first line contains an integer \( T \), the number of test cases.
  • For each test case:
    • The first line contains an integer \( n \), the number of confirmation numbers.
    • The second line contains \( n \) space-separated integers representing the confirmation numbers.

You may assume that \( n \) is at least 1.

outputFormat

For each test case, output a single line containing the smallest missing confirmation number.

The result is printed on standard output (stdout).

## sample
2
5
1 2 4 5 6
4
3 2 5 1
3

4

</p>