### 1550: Mex Query

[状态] [讨论版] [提交] [命题人:]

Give n non‑negative integers, please find the least non‑negative integer that doesn’t occur in the n numbers.

The first line is an integer T, representing the number of test cases.
For each test case:
The first line of each test case is an integer n
The second line of each test case are n non‑negative integers ai.
(T ≤ 10,  n ≤ 2 × 105,  0 ≤ ai < 231)

for each test case, output a line with the answer

2
4
4 0 1 3
2
1 1

2
0