Longest Common Substring
Med Given two strings, find the longest common substring.
Return the length of it.
Thoughts
f[i][j]表示第i个字符和第j个字符作为lcs的尾时最长长度。不难,但思路相比前两道题需要稍微转换下。
Code
Analysis
TC: O(mn)
Last updated
Was this helpful?
Med Given two strings, find the longest common substring.
Return the length of it.
f[i][j]表示第i个字符和第j个字符作为lcs的尾时最长长度。不难,但思路相比前两道题需要稍微转换下。
TC: O(mn)
Last updated
Was this helpful?