mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Add LCS.
This commit is contained in:
24
src/algorithms/string/longest-common-substring/README.md
Normal file
24
src/algorithms/string/longest-common-substring/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Longest Common Substring Problem
|
||||
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
- [Wikipedia](https://en.wikipedia.org/wiki/Longest_common_substring_problem)
|
||||
- [YouTube](https://www.youtube.com/watch?v=BysNXJHzCEs)
|
||||
Reference in New Issue
Block a user