Longest common substring: Difference between revisions
Content added Content deleted
(Added Prolog) |
m (added whitespace before the table of contents (TOC), added ;References, moved referenced to bottom (end) of the task's preamble.) |
||
Line 2: | Line 2: | ||
Write a function that returns the longest common substring of two strings. Use it within a program that demonstrates sample output from the function, which will consist of the longest common substring between "thisisatest" and "testing123testing". Note that substrings are consecutive characters within a string. This distinguishes them from subsequences, which is any sequence of characters within a string, even if there are extraneous characters in between them. Hence, the [[longest common subsequence]] between "thisisatest" and "testing123testing" is "tsitest", whereas the longest common sub''string'' is just "test". |
Write a function that returns the longest common substring of two strings. Use it within a program that demonstrates sample output from the function, which will consist of the longest common substring between "thisisatest" and "testing123testing". Note that substrings are consecutive characters within a string. This distinguishes them from subsequences, which is any sequence of characters within a string, even if there are extraneous characters in between them. Hence, the [[longest common subsequence]] between "thisisatest" and "testing123testing" is "tsitest", whereas the longest common sub''string'' is just "test". |
||
⚫ | |||
⚫ | |||
⚫ | |||
{{Template:Strings}} |
{{Template:Strings}} |
||
⚫ | |||
⚫ | |||
⚫ | |||
<br><br> |
|||
=={{header|Aime}}== |
=={{header|Aime}}== |