LogiQuest

419. Maximum Vowels in a Substring of Length K

MediumSliding Window

Print the maximum number of vowels (a, e, i, o, u) in any substring of length k.

Input format

Line 1: s Line 2: k

Output format

The maximum vowel count.

Example 1

Input

abciiidef
3

Output

3

Example 2

Input

aeiou
2

Output

2

Constraints

1 ≤ k ≤ |s| ≤ 10⁵

Read input from standard input and print the answer to standard output. Your code is judged against 4 test cases, most of them hidden.

Loading the MyLoginn IDE…