For problem statement at 1000-1999/1700-1799/1700-1709/1702/problemC.txt this is a correct solution, but verifier at 1000-1999/1700-1799/1700-1709/1702/verifierC.go ends with test 36 failed: expected YES got NO
exit status 1 can you fix the verifier? package main
import (
"io"
"os"
)
func main() {
in, _ := io.ReadAll(os.Stdin)
pos := 0
nextInt := func() int {
for pos < len(in) && in[pos] <= 32 {
pos++
}
if pos >= len(in) {
return 0
}
res := 0
for pos < len(in) && in[pos] > 32 {
res = res*10 + int(in[pos]-'0')
pos++
}
return res
}
t := nextInt()
var out []byte
for i := 0; i < t; i++ {
n := nextInt()
k := nextInt()
first := make(map[int]int, n)
last := make(map[int]int, n)
for j := 0; j < n; j++ {
u := nextInt()
if _, ok := first[u]; !ok {
first[u] = j
}
last[u] = j
}
for j := 0; j < k; j++ {
a := nextInt()
b := nextInt()
f, okA := first[a]
l, okB := last[b]
if okA && okB && f < l {
out = append(out, "YES\n"...)
} else {
out = append(out, "NO\n"...)
}
}
}
os.Stdout.Write(out)
}