For problem statement at 1000-1999/1000-1099/1050-1059/1054/problemB.txt this is a correct solution, but verifier at 1000-1999/1000-1099/1050-1059/1054/verifierB.go ends with All 100 tests passed can you fix the verifier? package main
import (
"bufio"
"fmt"
"io"
"os"
)
func main() {
data, _ := io.ReadAll(os.Stdin)
pos := 0
nextInt := func() int64 {
for pos < len(data) && (data[pos] < '0' || data[pos] > '9') {
pos++
}
var v int64
for pos < len(data) && data[pos] >= '0' && data[pos] <= '9' {
v = v*10 + int64(data[pos]-'0')
pos++
}
return v
}
n := int(nextInt())
var mex int64 = 0
ans := -1
for i := 1; i <= n; i++ {
x := nextInt()
if ans == -1 {
if x > mex {
ans = i
} else if x == mex {
mex++
}
}
}
out := bufio.NewWriter(os.Stdout)
fmt.Fprint(out, ans)
out.Flush()
}