Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- )
- func main() {
- var n, t int
- var s string
- var m = make(map[string]int)
- fmt.Scanf("%d %d", &n, &t)
- fmt.Scan(&s)
- for i := 0; i <= len(s)-t; i ++ {
- key := s[i : i+t]
- m[key] ++
- if v, _ := m[key]; v >= 2 {
- fmt.Print("YES")
- }
- }
- fmt.Print("NO")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement