📅  最后修改于: 2022-03-11 14:48:56.835000             🧑  作者: Mango
public int solution(int[] A)
{
var val = new HashSet(A).Where(x => x >= 1).OrderBy((y) =>y).ToArray();
var minval = 1;
for (int i = 0; i < val.Length; i++)
{
if (minval < val[i])
{
return minval;
}
minval = val[i] + 1;
}
return minval;
}