Loading
Loading
A transmission is a string of letters. Certain letters — a, e, i, o and u — carry the signal; the rest are filler.
Return the maximum number of signal letters in any window of exactly k consecutive characters.
transmission = "abciiidef", k = 3[abc]iiidef1 signal lettera[bci]idef1abc[iii]def3 — the maximum3Sign in to keep a note here. It is free, and nobody else can see it.
Sign inExample 1
Sign in to open hints.
Struggling is where the learning happens. Open this once you have genuinely tried, or once the hints have run out.
O(n) time · O(1) space
Input. Run your code to watch it work on this input, one line at a time.
Running code is turned off on this deployment. You can still read the problem, write code, use hints and the visualizer.
Tab moves focus out of the editor. Press Ctrl+M to let Tab indent instead.
No results yet
Run your code against the sample tests, or submit to run the full suite.
The window "iii" holds three signal letters.
Example 2
"lee" and "eet" both hold two.
Example 3
No signal letters at all.