All the letters of the English alphabet are divided into vowels and consonants.
The vowels are: a, e, i, o, u, y.
The remaining letters are consonants.
A word is considered euphonious if it doesn't have three or more vowels or consonants in a row. Otherwise, it is considered discordant.
Your task is to create euphonious words from the discordant ones. You can insert any letters inside the word. Output the minimum number of characters needed to create a euphonious word from a given word.
For example, the word "schedule" is considered discordant because it has three consonants in a row: "sch". To create a euphonious word you need to add any vowel between 's' and 'c' or between 'c' and 'h'.
Processing strings
Create a euphonious word
Report a typo
Sample Input 1:
scheduleSample Output 1:
1Sample Input 2:
garageSample Output 2:
0Sample Input 3:
playerSample Output 3:
1Sample Input 4:
biiiiigSample Output 4:
2Write a program in Kotlin
fun main() {
// 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.