*** Welcome to piglix ***

Longest common substring problem


In computer science, the longest common substring problem is to find the longest string (or strings) that is a substring (or are substrings) of two or more strings.

The longest common substring of the strings "ABABC", "BABCA" and "ABCBA" is string "ABC" of length 3. Other common substrings are "A", "AB", "B", "BA", "BC" and "C".

Given two strings, of length and of length , find the longest strings which are substrings of both and .


...
Wikipedia

...