---
# System prepended metadata

title: 2586. Count the Number of Vowel Strings in Range
tags: [Leetcode, Easy]

---

# 2586. Count the Number of Vowel Strings in Range
###### tags: `Leetcode` `Easy`
Link: https://leetcode.com/problems/count-the-number-of-vowel-strings-in-range/description/
## Code
```python=
class Solution:
    def vowelStrings(self, words: List[str], left: int, right: int) -> int:
        def isVowelString(word: str) -> bool:
            vowels = {'a', 'e', 'i', 'o', 'u'}
            return word[0] in vowels and word[-1] in vowels

        ans = 0
        for i in range(max(0, left), min(right+1, len(words))):
            if isVowelString(words[i]): ans += 1
        return ans
```