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

import (
	"fmt"
	"io"
	"os"
	"strings"
)

func main() {
	b, _ := io.ReadAll(os.Stdin)
	s := string(b)
	xCount := strings.Count(s, "x")
	yCount := strings.Count(s, "y")

	if xCount > yCount {
		fmt.Println(strings.Repeat("x", xCount-yCount))
	} else if yCount > xCount {
		fmt.Println(strings.Repeat("y", yCount-xCount))
	}
}