Description
Given a string word, return the number of substrings that contain all five vowels ("aeiou") at least once and contain only vowels.
Examples
Input:
word = "aeiouu"Output:
2Explanation:
aeiou and eiouu contain all vowels.
Input:
word = "unicornarihan"Output:
0Explanation:
No substring of length 5 contains all five vowels (a, e, i, o, u), so the count is 0.
Input:
word = "aeiouaeiou"Output:
36Explanation:
This string contains two complete sets of vowels. Valid substrings include: aeiou (positions 0-4), aeiouae (0-5), aeiouaei (0-6), aeiouaeio (0-7), aeiouaeiou (0-9), eiouae (1-5), eiouaei (1-6), eiouaeio (1-7), eiouaeiou (1-9), iouaei (2-6), iouaeio (2-7), iouaeiou (2-9), ouaeio (3-7), ouaeiou (3-9), uaeiou (4-9), and aeiou (positions 5-9), plus many others that span across both vowel sets.
Constraints
- •
1 ≤ word.length ≤ 100