SnowflakeOA #5
Vowel Substring — Substrings Made of Vowels with All 5 Present
Estimated MediumJudge-ready
Topics (AI-labelled)Two PointersHashing
Count all contiguous substrings that contain only aeiou and in which each of the five vowels appears at least once, and output the exact integer.
Input
One line containing a string over a..z of length 1..100000.
Output
Output the single integer required by the problem.
Example 1
Input:
aeiou
Output:
1
Example 2
Input:
aaeiouu
Output:
4
Example 3
Input:
aeiobuaeiou
Output:
3
Example notes
The answers to the three public examples are, in order: 1; 4; 3. All examples have been verified by independent small-scale enumeration or state search.
Editorial
Loading solution…