没用二分法,直接for循环找
public int solve (int[] a) {
// write code here
for (int i = 0; i < a.length - 1; i++) {
if (a[i] + 1 != a[i+1]) {
return a[i] + 1;
}
}
if (a[0] == 0)
return a[a.length - 1] + 1;
else
return 0;
}