class Solution(object):

    def maxVowels(self, s, k):
        """
        :type s: str
        :type k: int
        :rtype: int
        """
        cnt = 0
        res = 0
        vowels = ['a', 'e', 'i', 'o', 'u']
        j = 0
        i = 0
        for ch in s:
            if ch in vowels:
                cnt += 1
            while i - j + 1 > k:
                if s[j] in vowels:
                    cnt -= 1
                j += 1
            res = max(res, cnt)
            i += 1
        return res

74eb3d04c25b9faaf5928373f0f3c1b439f6cff2
<mask token>

class Solution(object):
    <mask token>

class Solution(object):

    def maxVowels(self, s, k):
        """
        :type s: str
        :type k: int
        :rtype: int
        """
        cnt = 0
        res = 0
        vowels = ['a', 'e', 'i', 'o', 'u']
        j = 0
        i = 0
        for ch in s:
            if ch in vowels:
                cnt += 1
            while i - j + 1 > k:
                if s[j] in vowels:
                    cnt -= 1
                j += 1
            res = max(res, cnt)
            i += 1
        return res
