Question: Python Problem 3 (30 points). Longest Common SubString In this problem, you may use the in operator for strings: if u and v are strings,
Python

Problem 3 (30 points). Longest Common SubString In this problem, you may use the in operator for strings: if u and v are strings, u in v returns True if u is a substring of v, and returns False otherwise. Given two strings s and t, we are interested in substrings w common to both s and t, i.e., in terms of the in operator, w in s and w in t. We would like to find the maximum length of such w. Implement a function lengthLCSS(s, t) which, given two strings s and t, returns the maximum length of a substring w common to both s and t. Notes: The longest common substring may not be unique, but the maximum length of a common substring the value we are interested in computing is unique. Note that the comparison is case sensitive, e.g., the characters 'B' and 'b' are not equal. Sample outputs given below, where a longest common substring is underlined. Test program/output: print(lengthLCSS("Ballouta zghire", "Une ballouta kbire")) 8 print(lengthLCSS("abcdefghik", "zxyabczzfghik")) print(lengthLCSS("Why", "Pourquoi")) print(lengthLCSS("","empty")) print(lengthLCSS("Two maximal substrings", "Twomax")) WOO 000 Any correct solution is worth 27 points. Faster solutions are worth more points. Efficient solutions are worth up to 10 additional bonus points
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
