#K82202. Smallest Missing Positive
Smallest Missing Positive
Smallest Missing Positive
Given an array of integers, your task is to find the smallest positive integer that is not present in the array. In other words, find the smallest integer \(x\) (with \(x \ge 1\)) such that \(x \notin A\), where \(A\) is the given array.
The array may contain both positive and negative integers. There are \(T\) test cases; process each test case independently.
Note: Use efficient algorithms to handle large input sizes.
inputFormat
The first line contains a single integer \(T\) (the number of test cases). For each test case, there are two lines:
- The first line contains an integer \(N\) representing the size of the array.
- The second line contains \(N\) integers separated by spaces.
outputFormat
For each test case, print a single line containing the smallest positive integer that does not appear in the array.
## sample2
5
3 4 -1 1 2
3
1 2 0
5
3
</p>