← Home
For problem statement at 0-999/200-299/270-279/278/problemB.txt this is a correct solution, but verifier at 0-999/200-299/270-279/278/verifierB.go ends with All tests passed can you fix the verifier? package main

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

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

	var n int
	fmt.Fscan(in, &n)

	var seen1 [26]bool
	var seen2 [26][26]bool
	var seen3 [26][26][26]bool

	for i := 0; i < n; i++ {
		var s string
		fmt.Fscan(in, &s)
		b := []byte(s)
		for j := 0; j < len(b); j++ {
			x := b[j] - 'a'
			seen1[x] = true
			if j+1 < len(b) {
				y := b[j+1] - 'a'
				seen2[x][y] = true
				if j+2 < len(b) {
					z := b[j+2] - 'a'
					seen3[x][y][z] = true
				}
			}
		}
	}

	for a := 0; a < 26; a++ {
		if !seen1[a] {
			fmt.Fprintf(out, "%c", 'a'+byte(a))
			return
		}
	}

	for a := 0; a < 26; a++ {
		for b := 0; b < 26; b++ {
			if !seen2[a][b] {
				fmt.Fprintf(out, "%c%c", 'a'+byte(a), 'a'+byte(b))
				return
			}
		}
	}

	for a := 0; a < 26; a++ {
		for b := 0; b < 26; b++ {
			for c := 0; c < 26; c++ {
				if !seen3[a][b][c] {
					fmt.Fprintf(out, "%c%c%c", 'a'+byte(a), 'a'+byte(b), 'a'+byte(c))
					return
				}
			}
		}
	}
}