← Home
For problem statement at 0-999/200-299/290-299/299/problemB.txt this is a correct solution, but verifier at 0-999/200-299/290-299/299/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)
	var n, k int
	fmt.Fscan(in, &n, &k)
	var s string
	fmt.Fscan(in, &s)

	c := 0
	for i := 0; i < n; i++ {
		if s[i] == '#' {
			c++
			if c >= k {
				fmt.Println("NO")
				return
			}
		} else {
			c = 0
		}
	}
	fmt.Println("YES")
}