CentralNotice From Wikipedia, the free encyclopedia Jump to: navigation , search Not to be confused with longest common subsequence 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. 1 Example 2 Problem definition 3 Algorithms 3.1 Suffix tree 3.2 Dynamic programming 4 Pseudocode 5 See also 6 References 7 External links Example [ edit ] 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". ABABC ||| BABCA ||| ABCBA Problem definition [ edit ] Given two strings, of length and of length , find the longest strings which are substrings of both and . A generalisation is the k-common substring problem . G...