For problem statement at 1000-1999/1400-1499/1420-1429/1428/problemB.txt this is a correct solution, but verifier at 1000-1999/1400-1499/1420-1429/1428/verifierB.go ends with All 100 tests passed can you fix the verifier? package main
import (
"bufio"
"fmt"
"os"
)
func main() {
in := bufio.NewReader(os.Stdin)
out := bufio.NewWriter(os.Stdout)
defer out.Flush()
var t int
if _, err := fmt.Fscan(in, &t); err != nil {
return
}
for ; t > 0; t-- {
var n int
var s string
fmt.Fscan(in, &n)
fmt.Fscan(in, &s)
hasR, hasL := false, false
for i := 0; i < n; i++ {
if s[i] == '>' {
hasR = true
} else if s[i] == '<' {
hasL = true
}
}
if !(hasR && hasL) {
fmt.Fprintln(out, n)
continue
}
ans := 0
for i := 0; i < n; i++ {
if s[i] == '-' || s[(i-1+n)%n] == '-' {
ans++
}
}
fmt.Fprintln(out, ans)
}
}