Longest Common Substring
Given two lowercase alphabet strings s0
, and s1
, return the length of their longest common substring.
Constraints
n, m ≤ 1000
wheren
andm
are the lengths ofs0
ands1
https://binarysearch.com/problems/Longest-Common-Substring
Examples
Example 1
Input
- s0 =
helloworld
- s1 =
worldpine
Output
- answer =
5
Explanation
“world” is the longest common substring between the two strings.
Leave a comment