← 返回 citadel 的题目列表Maximize Prefix and Suffix String Match Score
类型:online_judge
citadel
Given three strings: text, prefixString, and suffixString. Calculate:
prefix score - the longest matching substring at the end of prefixString
suffix score - the longest matching substring at the start of suffixString
total score - the sum of prefixScore and suffixScore Return the substring of text which begins with the matched prefix, ends with the matched suffix, and has the highest total score.
Example
Input
engine raven ginkgo