Question: Given a string of lowercase English letters and an integer of the substring length, determine the substring of that length that contains the most vowels.
Given a string of lowercase English letters and an integer of the substring length, determine the substring of that length that contains the most vowels. Vowels are in the set If there is more than one substring with the maximum number of vowels, return the one that starts at the lowest index. If there are no vowels in the input string, return the string 'Not found! without quotes.
Example
'caberqiitefg'
The substring of length that contains the maximum number of vohels is 'erqii' with vowels.
The final answer is 'erqii'.
Example
'aeiouia'
All of the characters are vowels, so any substring of length will have vowels. The lowest index substring is at index 'aei'.
Function Description
Complete the function findSubstring in the editor below.
findSubstring has the following parameters:
Returns:
string: a string containing the final answer
Constraints
lengths
lengths
Input Format For Custom Testing
Sample Case
Sample Input
tableSTDINFunctionazerdii azerdii'
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
