Question: eft 2. Missing Words Given two strings, one is a subsequence if all of the elements of the first string occur in the same

eft 2. Missing Words Given two strings, one is a subsequence if

eft 2. Missing Words Given two strings, one is a subsequence if all of the elements of the first string occur in the same order within the second string. They do not have to be contiguous in the second string, but order must be maintained. For example, given the string 'I like cheese', the words ('I', 'cheese') are one possible subsequence of that string. Words are space delimited. Given two strings, s and t, where t is a subsequence of s, report the words of s, missing in t (case sensitive), in the order they are missing. Example s='l like cheese' t = 'like' Then 'like' is the subsequence, and ['I', 'cheese'] is the list of missing words, in order. Function Description Complete the function missingWords in the editor below. missingWords has the following parameter(s): string s: a sentence of space-separated words string t: a sentence of space-separated words Returns: string[i]: an array of strings that contains all words in s that are missing from t, in the order they occur within s Constraints Strings s and t consist of English alphabetic letters (i.e., a-z and A-Z), dash '-', and spaces only. All words are delimited by a space . 1s/t/s/s/ 106 1 length of any word in s or t 15 C ght rain Search PRE

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!