Count Vowel Substrings of a String
Problem statement
A vowel substring is a non-empty contiguous substring that contains only the lowercase vowels a, e, i, o, and u, and contains all five vowels at least once.
Given a lowercase English string word, return the number of vowel substrings.
Function
countVowelSubstrings(word: String) → longExamples
Example 1
word = "aeiouu"return = 2The valid substrings are aeiou and aeiouu.
Example 2
word = "unicornarihan"return = 0No all-vowel substring contains every vowel.
Example 3
word = "cuaieuouac"return = 7Seven contiguous substrings contain only vowels and include all five vowel types.
Constraints
1 <= word.length() <= 100000.wordcontains only lowercase English letters.- The answer fits in a signed 64-bit integer.