Count Vowel Substrings of a String

A substring is a contiguous non-empty sequence of characters within a string.

A vowel substring is a substring that only consists of vowels ('a', 'e', 'i', 'o', and 'u') and has all five vowels present in it.

Given a string word, return the number of vowel substrings in word.

Example 1
Inputword = "aeiouu"
Output2
The vowel substrings are aeiou and aeiouu.
Example 2
Inputword = "unicornarihan"
Output0
Not all 5 vowels are present, so there are no vowel substrings.

Constraints

  • 1 <= word.length <= 100
  • word consists of lowercase English letters only.

Asked at 12 companies

</>

Your Solution

(Ctrl/Cmd + Enter)

Switching Language

Loading template...

Loading...

Sign in to save your progress

AI code evaluation

Get a correctness verdict, missed edge cases, and complexity analysis of your solution.

Sign in to evaluate