Maximal Substring

Start Timer

0:00:00

Upvote
1
Downvote
Save question
Mark as completed
View comments (7)

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.

.
.
.
.
.


Comments

Loading comments