Interview Query

Maximal Substring

0
Have you seen this question before?

Given two strings, string1 and string2, write a function max_substring to return the maximal substring shared by both strings.

Example:

Input:

string1 = 'mississippi'

string2 = 'mossyistheapple'

Output:

def maximal_substring(string1, string2) ->  'mssispp'

Note: If there are multiple max substrings with the same length just return any one of them.

Next question: Significance Time Series
.....
Python 3.9.6
Loading editor
Use Shift + Enter to run code