Interview Query

Maximum Common Substring

Start Timer

0:00:00

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

Given two strings, write a function max_common_substring that finds the longest common substring between the input strings.

A substring is a contiguous sequence of characters within a string. If there is no common substring, your function should return an empty string.

Example:

Input:

string1 = "Python"
string2 = "Phython"

Output:

max_common_substring(string1, string2) -> "ython"
.
.
.
.
.


Comments

Loading comments