# 1456. Maximum Number of Vowels in a Substring of Given Length
from collections import deque
class Solution:
    def maxVowels(self, s: str, k: int) -> int:
        dq, ans, vowel_cnt = deque(), 0, 0
        
        for c in s:
            dq.append(c)
            if c in 'aeiou':
                vowel_cnt += 1
            if len(dq) > k:
                left_chr = dq.popleft()
                if left_chr in 'aeiou':
                    vowel_cnt -= 1
            
            ans = max(ans, vowel_cnt)
        
        return ans

1aaf55ec74e0d44d0ed3e952a73ce292ba000f27
<mask token>

<mask token>


class Solution:
    <mask token>

<mask token>


class Solution:

    def maxVowels(self, s: str, k: int) ->int:
        dq, ans, vowel_cnt = deque(), 0, 0
        for c in s:
            dq.append(c)
            if c in 'aeiou':
                vowel_cnt += 1
            if len(dq) > k:
                left_chr = dq.popleft()
                if left_chr in 'aeiou':
                    vowel_cnt -= 1
            ans = max(ans, vowel_cnt)
        return ans

from collections import deque


class Solution:

    def maxVowels(self, s: str, k: int) ->int:
        dq, ans, vowel_cnt = deque(), 0, 0
        for c in s:
            dq.append(c)
            if c in 'aeiou':
                vowel_cnt += 1
            if len(dq) > k:
                left_chr = dq.popleft()
                if left_chr in 'aeiou':
                    vowel_cnt -= 1
            ans = max(ans, vowel_cnt)
        return ans

# 1456. Maximum Number of Vowels in a Substring of Given Length
from collections import deque
class Solution:
    def maxVowels(self, s: str, k: int) -> int:
        dq, ans, vowel_cnt = deque(), 0, 0
        
        for c in s:
            dq.append(c)
            if c in 'aeiou':
                vowel_cnt += 1
            if len(dq) > k:
                left_chr = dq.popleft()
                if left_chr in 'aeiou':
                    vowel_cnt -= 1
            
            ans = max(ans, vowel_cnt)
        
        return ans
