← Home
For problem statement at 1000-1999/1900-1999/1970-1979/1971/problemB.txt this is a correct solution, but verifier at 1000-1999/1900-1999/1970-1979/1971/verifierB.go ends with All tests passed can you fix the verifier? ```go
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var t int
	fmt.Fscan(reader, &t)

	for i := 0; i < t; i++ {
		var s string
		fmt.Fscan(reader, &s)

		allSame := true
		for j := 1; j < len(s); j++ {
			if s[j] != s[0] {
				allSame = false
				break
			}
		}

		if allSame {
			fmt.Fprintln(writer, "NO")
			continue
		}

		b := []byte(s)
		sort.Slice(b, func(i, j int) bool { return b[i] < b[j] })
		r := string(b)
		if r == s {
			for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
				b[i], b[j] = b[j], b[i]
			}
			r = string(b)
		}

		fmt.Fprintln(writer, "YES")
		fmt.Fprintln(writer, r)
	}
}
```