Given a string of lowercase letters in the range ascii[a-z], determine the number of substrings that can be created where every letter is a vowel and every vowel is present at least once. The vowels are ['a', 'e', 'i', 'o', 'u']. A substring is a contiguous group of characters in the string.
Complete the function vowelSubstring in the editor.
vowelSubstring has the following parameter(s):
- 1.
string s: a string
Returns
int: the number of substrings that consist of vowels only ('a', 'e', 'i', 'o', 'u') where every vowel appears at least once
🌷ଓ Credit where it's due – A!˶ᵔ ᵕ ᵔ˶ ᯓᡣ𐭩
s = "aaeiouxa" return = 2
There are two qualifying substrings:
s[0:5] = "aaeiou"
s[1:5] = "aeiou"
s = "axyzaeiou" return = 1
There is only one qualifying substring:
s[4:8] = "aeiou"
1 ≤ size_of(s) ≤ 10^5s[i] ∈ ascii[a-z] (where 0 ≤ i < size_of(s))- Effective Role PrivilegesPHONE SCREEN · Seen May 2026
- Minimum Clicks Between Wiki PagesOA · Seen May 2026
- Minimum Index Distance Between Person and CakeOA · Seen May 2026
- Simple Array Rotation GameSeen Apr 2026
- Max Element Indexes After RotationsOA · Seen Mar 2026
- String Formation (Also for AI/ML Software Engineer Intern :)OA · Seen Mar 2026
- Grid Traversal (Infrastructure Automation Internship)Seen May 2025
- Horizontal Pod Autoscaler (Infrastructure Automation Internship)Seen May 2025
public int vowelSubstring(String s) {
// write your code here
}