← Home
For problem statement at 0-999/400-499/490-499/496/problemB.txt this is a correct solution, but verifier at 0-999/400-499/490-499/496/verifierB.go ends with All 100 tests passed can you fix the verifier? package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var s string
	fmt.Scan(&s)

	best := ""

	for i := 0; i < n; i++ {
		shifted := s[i:] + s[:i]
		diff := (10 - int(shifted[0]-'0')) % 10

		current := make([]byte, n)
		for j := 0; j < n; j++ {
			current[j] = byte((int(shifted[j]-'0')+diff)%10 + '0')
		}

		strCurrent := string(current)
		if best == "" || strCurrent < best {
			best = strCurrent
		}
	}

	fmt.Println(best)
}