Count Vowels in a String - aloalgo

Count Vowels in a String

Very Easy

You are given a string s containing only lowercase English letters, your task is to return the number of vowels in the string.

The vowels are 'a', 'e', 'i', 'o', and 'u'.

Example 1

Input
"hello"
Output
2
Explanation:

The vowels are 'e' and 'o'.

Example 2

Input
"programming"
Output
3
Explanation:

The vowels are 'o', 'a', and 'i'.

Example 3

Input
"rhythm"
Output
0
Explanation:

There are no vowels in this string.

Loading...
Input
"hello"
Output
2

Hello! I am your ✨ AI assistant. I can provide you hints, explanations, give feedback on your code, and more. Just ask me anything related to the problem you're working on!