Given a lowercase string text, return how many vowels (a, e, i, o, u) it contains.
Count Vowels (Set 10) — the data. This set runs 4 cases: text is a string of 41–47 characters. The hidden cases are the largest of the set.
Example 1
countVowels()
Input
text ="vuyitirjcvaodqkarjgbadmcwmqtvokojcunwyjdfcxwkxs"
Output
10
Why
`countVowels` returns `10`forthisinput.
Example 2
countVowels()
Input
text ="rqzmxbzfmxqrqcknunoxeqyjertkthwyfjuzblkwposttj"
Output
6
Why
`countVowels` returns `6`forthisinput.
Constraints
0<=text.length<=10^5`text` contains lowercase letters only.
Every caseinthisset must pass: the first two are visible on Run, the last two unlock on Submit.
Topics
StringsCounting
Implement countVowels in the editor and return the answer — printing it is never graded.