Count Vowel Substrings of a String
Difficulty: Easy
Source: LeetCode
Description
Given a string word, return the number of vowel substrings in word.
A vowel substring is a contiguous substring that:
- Only consists of vowels (
'a','e','i','o','u') - Contains all five vowels at least once
Examples
Input: word = "aeiouu"
Output: 2
Explanation: The vowel substrings are "aeiou" and "aeiouu"
Input: word = "unicornarihan"
Output: 0
Explanation: Not all 5 vowels are present, so there are no vowel substrings
Code
# To be solved