Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

=+Who's your primary audience?

Answered: 1 week ago

Question

Is the person willing to deal with the consequences?

Answered: 1 week ago