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.
CharSequence
Number of vowels
Report a typo
Sample Input 1:
hello worldSample Output 1:
3Write a program in Kotlin
fun countVowels(charSequence: CharSequence): Int {
// write your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.