Skip to main content
CodeOath
← All problems

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.

Example 1
Input
str = "Odysseus"
Output
3
Explanation

the vowels are O, e and u.

Example 2
Input
str = "AEIOU"
Output
5
Explanation

capital letters count too.

Example 3
Input
str = "xyz"
Output
0
Explanation

none of the letters is a vowel.

Tab indents. Press Esc, then Tab to leave the editor.

Run your code to see every test here. Nothing is submitted or recorded.