<p>Given a string <code>s</code> and an integer <code>k</code>, return <em>the maximum number of vowel letters in any substring of </em><code>s</code><em> with length </em><code>k</code>.</p>

<p><strong>Vowel letters</strong> in English are <code>&#39;a&#39;</code>, <code>&#39;e&#39;</code>, <code>&#39;i&#39;</code>, <code>&#39;o&#39;</code>, and <code>&#39;u&#39;</code>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;abciiidef&quot;, k = 3
<strong>Output:</strong> 3
<strong>Explanation:</strong> The substring &quot;iii&quot; contains 3 vowel letters.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;aeiou&quot;, k = 2
<strong>Output:</strong> 2
<strong>Explanation:</strong> Any substring of length 2 contains 2 vowels.
</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;leetcode&quot;, k = 3
<strong>Output:</strong> 2
<strong>Explanation:</strong> &quot;lee&quot;, &quot;eet&quot; and &quot;ode&quot; contain 2 vowels.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= s.length &lt;= 10<sup>5</sup></code></li>
	<li><code>s</code> consists of lowercase English letters.</li>
	<li><code>1 &lt;= k &lt;= s.length</code></li>
</ul>

//1456
class Solution {
public:
    bool check(char c){
        return c == 'a' || c == 'e' || c == 'i' || c == 'o'|| c == 'u';
    }

    int maxVowels(string_view s, int k) {
        int num{0}, Max{0};
        for(auto i{0}; i<k; ++i){
            if(check(s[i])) ++num;
        }
        
        Max = num;

        for(auto i{k}; i<s.length(); ++i){
            if(check(s[i-k])) --num;
            if(check(s[i])) ++num;
            Max = max(num, Max);
        }
        return Max;
    }
    
};
/*
<389>
string s, t 입력 받은 후
s의 길이 (n)만큼 for문 O(n)
t의 길이 (n+1)만큼 for문 O(n+1) -> 문제에서 t의길이는 항상 s의 길이보다 1큼
for문(0~25)을 통해 freq를 탐색
총 O(n)의 비용이 든다.  

<1456>
string s, char k를 입력받은 후 
k만큼 for문을 통해 초기 모음 갯수 얻기 O(k)
s의 길이 만큼 for문을 통해 슬라이딩 윈도우 진행 O(n)
총 O(n)의 비용이 든다.
*/
10800