← Home
For problem statement at 0-999/600-699/660-669/665/problemC.txt this is a correct solution, but verifier at 0-999/600-699/660-669/665/verifierC.go ends with All tests passed can you fix the verifier? package main

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

func main() {
	var s string
	fmt.Fscan(bufio.NewReader(os.Stdin), &s)
	b := []byte(s)
	n := len(b)
	for i := 1; i < n; i++ {
		if b[i] == b[i-1] {
			next := byte(0)
			if i+1 < n {
				next = b[i+1]
			}
			for c := byte('a'); c <= byte('c'); c++ {
				if c != b[i-1] && c != next {
					b[i] = c
					break
				}
			}
		}
	}
	fmt.Println(string(b))
}