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

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

func isPal(s string) bool {
	n := len(s)
	for i := 0; i < n/2; i++ {
		if s[i] != s[n-1-i] {
			return false
		}
	}
	return true
}

func reverse(s string) string {
	b := []byte(s)
	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
		b[i], b[j] = b[j], b[i]
	}
	return string(b)
}

func getCandidates(cur string) []string {
	n := len(cur)
	var res []string
	revCur := reverse(cur)
	
	// m == n
	res = append(res, revCur)
	
	// m < n: prev is shorter
	for m := 1; m < n; m++ {
		prefix := cur[:n-m]
		if isPal(prefix) {
			suffix := cur[n-m:]
			prev := reverse(suffix)
			res = append(res, prev)
		}
	}
	
	// m > n: prev is longer, m = n+1 or n+2
	base := revCur
	// m = n+1
	for c := 'a'; c <= 'z'; c++ {
		res = append(res, base+string(c))
	}
	// m = n+2 (only if n <= 1)
	if n <= 1 {
		for c := 'a'; c <= 'z'; c++ {
			res = append(res, base+string(c)+string(c))
		}
	}
	
	return res
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	
	var t int
	fmt.Fscan(reader, &t)
	
	for tc := 0; tc < t; tc++ {
		var n int
		fmt.Fscan(reader, &n)
		s := make([]string, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &s[i])
		}
		
		found := false
		
		// Check single palindrome
		for _, str := range s {
			if isPal(str) {
				found = true
				break
			}
		}
		
		if !found {
			seen := make(map[string]bool)
			for _, str := range s {
				candidates := getCandidates(str)
				for _, c := range candidates {
					if seen[c] {
						found = true
						break
					}
				}
				if found {
					break
				}
				seen[str] = true
			}
		}
		
		if found {
			fmt.Fprintln(writer, "YES")
		} else {
			fmt.Fprintln(writer, "NO")
		}
	}
}
```