Easystrings
Count Vowels
Count how many characters of a string are vowels.
Return how many characters of text are vowels.
The vowels are a, e, i, o and u. Both cases count, so A and a are each a vowel. Every other character — consonants, digits, spaces, punctuation — is not.
Constraints
- 0 ≤ text.length ≤ 100,000
textcontains printable ASCII only
Examples
- Input
- text = "education"
- Output
- 5
- Why
- e, u, a, i, o.
- Input
- text = "Rhythm"
- Output
- 0
- Why
- No vowels at all.
- Input
- text = "AEIOU xyz"
- Output
- 5
- Why
- Uppercase vowels count too.
Submitting also runs 6 hidden tests.
Limits
2000 ms and 256 MB per test case.