Quant Memo
Coding/●●●●●

Most vowels in a window of length k

Given a string s and a window length k, find the maximum number of vowels (a e i o u) in any substring of exactly k consecutive characters.

s = "abciiidef", k = 3
-> 3           # "iii"

Return the maximum vowel count over all length-k windows. Aim for O(n)O(n), recounting each window is O(nk)O(nk).

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions