For problem statement at 1000-1999/1200-1299/1250-1259/1256/problemF.txt this is a correct solution, but verifier at 1000-1999/1200-1299/1250-1259/1256/verifierF.go ends with All 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 q int
fmt.Fscan(in, &q)
for i := 0; i < q; i++ {
var n int
fmt.Fscan(in, &n)
var s, t string
fmt.Fscan(in, &s, &t)
var countS, countT [26]int
for j := 0; j < n; j++ {
countS[s[j]-'a']++
countT[t[j]-'a']++
}
possible := true
for j := 0; j < 26; j++ {
if countS[j] != countT[j] {
possible = false
break
}
}
if !possible {
fmt.Fprintln(out, "NO")
continue
}
hasDuplicate := false
for j := 0; j < 26; j++ {
if countS[j] > 1 {
hasDuplicate = true
break
}
}
if hasDuplicate {
fmt.Fprintln(out, "YES")
} else {
invS := 0
for j := 0; j < n; j++ {
for k := j + 1; k < n; k++ {
if s[j] > s[k] {
invS++
}
}
}
invT := 0
for j := 0; j < n; j++ {
for k := j + 1; k < n; k++ {
if t[j] > t[k] {
invT++
}
}
}
if invS%2 == invT%2 {
fmt.Fprintln(out, "YES")
} else {
fmt.Fprintln(out, "NO")
}
}
}
}