#K33522. Maximum Vowel Count in a Substring
Maximum Vowel Count in a Substring
Maximum Vowel Count in a Substring
Given a string s
and an integer k
, find the maximum number of vowels in any contiguous substring of s
with length k
.
Vowels are defined as the letters \(a, e, i, o, u\) (both uppercase and lowercase). In other words, for any substring of s
of length \(k\), count the number of characters that belong to the set \(\{a, e, i, o, u, A, E, I, O, U\}\), and return the maximum count found.
inputFormat
The input is given via standard input (stdin
) and consists of two lines:
- The first line contains the string
s
. - The second line contains the integer
k
\( (1 \leq k \leq |s|) \).
outputFormat
Output a single integer to standard output (stdout
), representing the maximum number of vowels present in any substring of s
with length k
.
abciiidef
3
3