Practice Count Vowel Strings in Ranges
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given a 0-indexed array of strings words and a 2D array of integers queries. Each query queries[i] = [li, ri] asks us to find the number of strings present at the indices ranging from li to ri (both inclusive) of words that start and end with a vowel. Return an array ans of size queries.length, where ans[i] is the answer to the ith query. Note that the vowel letters are 'a', 'e', 'i', 'o', and 'u'.
Source: Count Vowel Strings in Ranges on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
words = ["aba","bcb","ece","aa","e"], queries = [[0,2],[1,4],[1,1]]
[2,3,0]
# Example 2
words = ["a","e","i"], queries = [[0,2],[0,1],[2,2]]
[3,2,1]
Constraints
Related LeetCode Problems
Practice more problems similar to Count Vowel Strings in Ranges.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.