You are given a string and a length . Are all the substrings of length of palindromes?
For instance, let
“ababa” and
.
Here, we have
“aba”,
“bab” and
“aba”. Since the three substrings of
of length 3 are palindomes, in this case the answer is positive.
Input consists of several cases, each with and . Let be the size of . You can assume , and that is made up of only lowercase letters.
For every case, print “yes” or “no”.
Author: Salvador Roura
Generation: 2026-01-25T10:12:41.353Z
© Jutge.org, 2006–2026.
https://jutge.org