Question: 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

 Problem 3 (30 points). Longest Common SubString In this problem, you

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 a 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 4. Implement a function lengthlCSS(8,t) which, given two strings a and t, returns the maximum length of a substring 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(lengthless ("Two maximal substrings" , "Twomax")) Any correct solution is worth 27 points. Faster solutions are worth more points. Efficient solutions are worth up to 10 additional bonus points. Submit your code in a file called Prob3.py including your name and ID number

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 Databases Questions!