Longest common substring: Difference between revisions

Content deleted Content added
remove the problem
Examples: Redoing double quotes around “uniting” under MOS:DOUBLE; removing lone serial comma under MOS:RETAIN; the serial comma is not used anywhere else in the page.
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 5:
==Examples==
[[File:LongestSubstring svg.svg|thumb|The strings "BADANAT" and "CANADAS" share the maximal-length substrings "ADA" and "ANA".]]
The picture shows two strings where the problem has multiple solutions. Although the substring occurrences always overlap, no longer common substring can be obtained by '"uniting'" them.
 
The strings "ABABC", "BABCA", and "ABCBA" have only one longest common substring, viz. "ABC" of length 3. Other common substrings are "A", "AB", "B", "BA", "BC" and "C".
 
ABABC