Python/dynamic_programming
Alfredo Hernandez Baeza 47a44abe23
Improve longest_common_substring.py (#12705)
* Update longest_common_substring.py

- Combined the ans_index and ans_length into a single tuple to track the best match (position + length) more cleanly.

- Early exit for empty strings.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update longest_common_substring.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
2025-05-10 14:57:43 +03:00
..
2020-04-17 20:04:30 +02:00
2023-05-14 22:03:13 +01:00
2023-10-29 18:24:37 +01:00