# Maximum Number of vowels in a substring of given Length.

**Maximum Number of Vowels in a Substring of Given Length**

Given a string `s`

and an integer `k`

.Return *the maximum number of vowel letters* in any substring of `s`

with length `k`

.**Vowel letters** in English are (a, e, i, o, u).

**Example 1:**

**Input:** s = "abciiidef", k = 3

**Output:** 3

**Explanation:** The substring "iii" contains 3 vowel letters.

**Example 2:**

**Input:** s = "aeiou", k = 2

**Output:** 2

**Explanation:** Any substring of length 2 contains 2 vowels.

**Example 3:**

**Input:** s = "leetcode", k = 3

**Output:** 2

**Explanation:** "lee", "eet" and "ode" contain 2 vowels.

**Example 4:**

**Input:** s = "rhythms", k = 4

**Output:** 0

**Explanation:** We can see that s doesn't have any vowel letters.

**Example 5:**

**Input:** s = "tryhard", k = 4

**Output:** 1

Solution approach:

We can solve this problem by using sliding window algorithm. We have list of values and given size of window.we need to slide the window one step at a time. First we need to calculate the number of vowels in first window for starting to Kth element. Afterward we will slide window one value at a time.

while sliding we need to remove first value from window and if that value is vowel , we need to decrement the current running vowel by one. Similarly we need to add a new value at the end and if that value is vowel we need to increment the current running vowel.

While doing that , we need to keep track of max number of vowels.