Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 404 Bytes

2586.md

File metadata and controls

15 lines (13 loc) · 404 Bytes

2586. Count the Number of Vowel Strings in Range

Solution 1 (time O(n), space O(1))

class Solution(object):
    def vowelStrings(self, words, left, right):
        """
        :type words: List[str]
        :type left: int
        :type right: int
        :rtype: int
        """
        return sum(words[i][0] in "aeiou" and words[i][-1] in "aeiou" for i in range(left, right + 1))