Question: Code Challenge: Assume that the variable text has already been defined with an arbitrary str value, consisting only of characters from the English alphabet. text
Code Challenge: Assume that the variable text has already been defined with an arbitrary str value, consisting only of characters from the English alphabet.
text
We will call the first index at which the number of vowels exceeds the number of consonants the critical index.
Print the critical index of text. If no critical index exists, print
Note: You can assume that text is completely lowercase.
Note: Only aeiou will be counted as vowels. All other letters are consonants.
Example : If text "gooey", the critical index is because that is the first index at which the number of vowels exceeds the number of consonants
Example : If text "axe", the critical index is because that is the first index at which the number of vowels exceeds the number of consonants
Example : If text "carrot", there is no critical index because there is no index at which the number of vowels exceeds the number of consonants. In this case, print
Sample Input:
gooey
Sample Output:
Write a program, test using stdin stdout
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
