Number of vowels

Report a typo

Implement a function countVowels(charSequence: CharSequence) that takes a CharSequence as input and returns the number of vowels (a, e, i, o, u, y) in the sequence.

Sample Input 1:

hello world

Sample Output 1:

3
Write a program in Kotlin
fun countVowels(charSequence: CharSequence): Int {
// write your code here
}
___

Create a free account to access the full topic