Description
Given a string s and an integer k, return the maximum number of vowel letters in any substring of s with length k.
Examples
Input:
s = "abciiidef", k = 3Output:
3Explanation:
"iii" has 3 vowels.
Input:
s = "leetcode", k = 3Output:
2Explanation:
The substring "eec" contains 2 vowels (e, e), which is the maximum possible for any substring of length 3.
Input:
s = "programming", k = 4Output:
1Explanation:
Multiple substrings of length 4 contain exactly 1 vowel each (like "prog", "rogr", "ogra", "gram", "ramm", "ammi", "mmin", "ming"), and this is the maximum possible.
Constraints
- •
1 ≤ s.length ≤ 10⁵