For problem statement at 1000-1999/1200-1299/1280-1289/1281/problemB.txt this is a correct solution, but verifier at 1000-1999/1200-1299/1280-1289/1281/verifierB.go ends with test 1 failed:
input:
10
DCDW OTR
RBE EVFSK
HC AD
HI RZSSY
MUMU WKY
XGB XA
HIBZGZ XIKYTW
DWRK FXTH
IZYF TPYJRP
OWUVL ETOR
expected:DCDW
BRE
---
HI
MUMU
BGX
HIBZGZ
DWRK
IZYF
---
got:CDDW
BRE
---
HI
MMUU
BGX
BIHZGZ
DKRW
FZYI
---
exit status 1 can you fix the verifier? ```go
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 i := 0; i < t; i++ {
var s, c string
fmt.Fscan(in, &s, &c)
b := []byte(s)
n := len(b)
minIndices := make([]int, n)
if n > 0 {
minIdx := n - 1
for j := n - 1; j >= 0; j-- {
if b[j] < b[minIdx] {
minIdx = j
}
minIndices[j] = minIdx
}
}
for j := 0; j < n-1; j++ {
target := minIndices[j+1]
if b[target] < b[j] {
b[j], b[target] = b[target], b[j]
break
}
}
res := string(b)
if res < c {
fmt.Fprintln(out, res)
} else {
fmt.Fprintln(out, "---")
}
}
}
```