Question: Language C++11 1 > #include ... 2. Substrings 6 7 * Consider a string, s = abc. An alphabetically-ordered sequence of substrings of s would

 Language C++11 1 > #include ... 2. Substrings 6 7 *

Language C++11 1 > #include ... 2. Substrings 6 7 * Consider a string, s = "abc". An alphabetically-ordered sequence of substrings of s would be {"a", 8 Complete the 'findSubstrings' function below. 9 "ab", "abc", "b", "bc", "c"). If the sequence is reduced to only those substrings that start with a 10 vowel and end with a consonant, the result is {"ab", "abc"). The alphabetically first element in this * The function accepts STRING s as parameter. 11 reduced list is "ab", and the alphabetically last element is "abc". As a reminder: 12 13 void findSubstrings (string s) { 14 Vowels: a, e, i, o, and u. 15 Consonants: b, c, d, f. g. h, j. k, I. m. n. p. q. r. s, t. v. w, x, y, and z. 16 17 > int main() ... For a given string, determine the alphabetically lowest and highest substrings that start with a vowel and end with a consonant. Function Description Complete the function findSubstrings in the editor below. The function must print the alphabetically first substring on the first line, followed by the alphabetically last substring on the next line. findSubstrings has the following parameter(s): s: a string Constraints 35 /5/ $5 x 105 Each character of s E ascii[a-z] Input Format For Custom Testing Input from stdin will be processed as follows and passed to the function. The first line contains a string, s. Sample Case 0 Sample Input For Custom Testing Sample Input 0 aba Sample Output 0 ab ab Explanation 0 "ab"is the only possible substring which starts with a vowel (a) and ends with a consonant (b). Because there is only 7 qualifying substring, "ab"is both the alphabetically first and last qualifying substring, thus it is printed on the first and second lines of output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!