mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 10:31:29 +08:00
Fix sphinx/build_docs warnings for dynamic_programming (#12484)
* Fix sphinx/build_docs warnings for dynamic_programming * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix * Fix * Fix * Fix * Fix * Fix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,15 +1,19 @@
|
||||
"""
|
||||
Longest Common Substring Problem Statement: Given two sequences, find the
|
||||
longest common substring present in both of them. A substring is
|
||||
necessarily continuous.
|
||||
Example: "abcdef" and "xabded" have two longest common substrings, "ab" or "de".
|
||||
Therefore, algorithm should return any one of them.
|
||||
Longest Common Substring Problem Statement:
|
||||
Given two sequences, find the
|
||||
longest common substring present in both of them. A substring is
|
||||
necessarily continuous.
|
||||
|
||||
Example:
|
||||
``abcdef`` and ``xabded`` have two longest common substrings, ``ab`` or ``de``.
|
||||
Therefore, algorithm should return any one of them.
|
||||
"""
|
||||
|
||||
|
||||
def longest_common_substring(text1: str, text2: str) -> str:
|
||||
"""
|
||||
Finds the longest common substring between two strings.
|
||||
|
||||
>>> longest_common_substring("", "")
|
||||
''
|
||||
>>> longest_common_substring("a","")
|
||||
|
Reference in New Issue
Block a user