Question: Substrings Consider a string, s-abe. An alphabetically-ordered sequence of substrings of s would be a ab abc be e if we reduce thine os eo
Substrings Consider a string, s-abe". An alphabetically-ordered sequence of substrings of s would be a ab abc be e if we reduce thine os eo to only those s o ings that stat a vowel and end with a consonant, we're left with ('ab", "abe"). The alphabetically first element in this reduced list is ab, and the alphabetically last element is "abc' As a reminder: ith Vowels:a, e, i, o, and u. Consonants: b, c, d, f.g.h,jk, l, m, n, pq.f,s,t, v,w,x,y, and z Complete the findSubstrings function in your editor.It has 1 parameter: a string, s, consisting of lowercase English letters (a -2) The function must find the substrings of s that start with vowel and end with a consonant, then print the alphabetically first and alphabetically last of these substrings Input Format The locked stub code in your editor reads a single string, s, from stdin and passes it to your function Constraints 3 s length of s s S 10 Output Format Your function substring on the first line, and the alphabetically last qualilying substring on the second line n must print two lines of output denoting the alphabetically first and last substrings of s that start with a wowel and end with a consonant. Print the a Sample Input 1 aba Sample Output 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
