← All problemsExample 1 Example 2 Example 3
Problem
Count Vowels
Easy- strings
Count the vowels in str: the letters a, e, i, o and u, in upper or lower case. Every other character, y included, is not counted.
- Input
str = "Odysseus"- Output
3- Explanation
the vowels are
O,eandu.
- Input
str = "AEIOU"- Output
5- Explanation
capital letters count too.
- Input
str = "xyz"- Output
0- Explanation
none of the letters is a vowel.
Tab indents. Press Esc, then Tab to leave the editor.
Ctrl or ⌘ + Enter runs the tests.
Run your code to see every test here. Nothing is submitted or recorded.