Question: Question 1 Given three strings, text, prefixpsitring, and suffixString, find: pretixiscore: the longest substring of text matching the end of prefixstring suffixScore: the longest substring

Question 1
Given three strings, text, prefixpsitring, and
suffixString, find:
pretixiscore: the longest substring of text matching
the end of prefixstring
suffixScore: the longest substring of text matching
the beginning of suffix String.
Sum the lengths of the two strings to get the
textScore. The substring of text that begins with the
matching prefix and ends with matching suffix, and
has the highest textScore, is the correct value to
return. If there are other substrings with equal
textScore, return the lexicographically lowest
substring.
Example
text = engine
prefix String = raven
suffixString = ginkgo
engine matches raven, so prefixScore =2
Question 1 Given three strings, text,

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!