Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Precompute the prefix sum of strings that start and end with vowels.
Use unordered_set to store vowels.
Check if the first and last characters of the string are present in the vowels set.
Subtract prefix sum for range [l-1, r] to find the number of strings starting and ending with vowels.