| Learn | Algorithm - Dynamic Programming - Longest common substring |
|---|
| Longest Common Substring Given 2 string str1 and str2 we have to find the length of the longest common substring between them. Examples Input : X = "abcdxyz", y = "xyzabcd" Output : 4 The longest common substring is "abcd" and is of length 4. Input : X = "zxabcdezy", y = "yzabcdezx" Output : 6 The longest common substring is "abcdez" and is of length 6. Implementation in Java Time Complexity O(m*n) |
Read Article
https://develop.horje.com/learn/1434/reference