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

import (
	"fmt"
)

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

	c4, c7 := 0, 0
	for _, ch := range s {
		if ch == '4' {
			c4++
		} else if ch == '7' {
			c7++
		}
	}

	if c4 == 0 && c7 == 0 {
		fmt.Println("-1")
	} else if c4 >= c7 {
		fmt.Println("4")
	} else {
		fmt.Println("7")
	}
}