← Home
For problem statement at 0-999/500-599/510-519/518/problemA.txt this is a correct solution, but verifier at 0-999/500-599/510-519/518/verifierA.go ends with case 24 failed: expected "No such string" got "z"
input:
z
zj
exit status 1 can you fix the verifier? package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var s, t string
	fmt.Fscan(in, &s, &t)

	b := []byte(s)
	for i := len(b) - 1; i >= 0; i-- {
		if b[i] < 'z' {
			b[i]++
			for j := i + 1; j < len(b); j++ {
				b[j] = 'a'
			}
			break
		}
	}

	next := string(b)
	if next < t {
		fmt.Println(next)
	} else {
		fmt.Println("No such string")
	}
}