问题1550-- Mex Query

1550: Mex Query

时间限制: 1Sec 内存限制:256 MB
提交:1167 解决:244
[ 状态] [ 讨论版] [ 提交] [命题人: ]
题目描述
Give nnon‑negative integers, please find the least non‑negative integer that doesn’t occur in the nnumbers.
输入
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 nnon‑negative integers a i .
( T ≤ 10, n ≤ 2 × 10 5 , 0 ≤ a i < 2 31 )
输出
for each test case, output a line with the answer
样例输入 Copy
2 4 4 0 1 3 2 1 1
样例输出 Copy
2 0
来源/分类