Longest Common Substring
Medium

Problem Statement

Given two strings, find the length of the longest substring that is common to both.

Examples

1Example 1
Input:
{ "s1": "AGGTAB", "s2": "GXTXAYB" }
Output:
1
2Example 2
Input:
{ "s1": "ABCDGH", "s2": "ACDGHR" }
Output:
4
3Example 3
Input:
{ "s1": "zxabcdezy", "s2": "yzabcdezx" }
Output:
6
Loading...

Sign in to Run Code and Submit