← Home
For problem statement at 0-999/900-999/930-939/938/problemA.txt this is a correct solution, but verifier at 0-999/900-999/930-939/938/verifierA.go ends with all tests passed can you fix the verifier? package main

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

func isVowel(c byte) bool {
	switch c {
	case 'a', 'e', 'i', 'o', 'u', 'y':
		return true
	}
	return false
}

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

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

	res := make([]byte, 0, len(s))
	for i := 0; i < len(s); i++ {
		c := s[i]
		if len(res) > 0 && isVowel(c) && isVowel(res[len(res)-1]) {
			continue
		}
		res = append(res, c)
	}
	fmt.Fprintln(out, string(res))
}