From b96c1eab9f3458ee212e774e0dc64bc85fb2a340 Mon Sep 17 00:00:00 2001 From: Keon Kim Date: Mon, 18 May 2026 00:08:15 -0400 Subject: [PATCH] Rename algorithms/map/longest_common_subsequence.py to longest_common_substring.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The file under algorithms/map/ actually implements longest common *substring* (contiguous), not longest common subsequence. The module docstring, the function name (`max_common_sub_string`), and the Wikipedia reference URL inside the file all already say "substring" — only the filename was wrong. The true longest common subsequence lives in algorithms/dynamic_programming/longest_common_subsequence.py. Updates the single import site in algorithms/map/__init__.py. The exported symbol name (`max_common_sub_string`) is unchanged, so no test or downstream caller needs to change. Closes #2747. Co-Authored-By: Claude Opus 4.7 (1M context) --- algorithms/map/__init__.py | 2 +- ...ongest_common_subsequence.py => longest_common_substring.py} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename algorithms/map/{longest_common_subsequence.py => longest_common_substring.py} (100%) diff --git a/algorithms/map/__init__.py b/algorithms/map/__init__.py index 0eeb6bd1a..7e8698e1f 100644 --- a/algorithms/map/__init__.py +++ b/algorithms/map/__init__.py @@ -9,7 +9,7 @@ from .is_anagram import is_anagram from .is_isomorphic import is_isomorphic -from .longest_common_subsequence import max_common_sub_string +from .longest_common_substring import max_common_sub_string from .longest_palindromic_subsequence import longest_palindromic_subsequence from .randomized_set import RandomizedSet from .valid_sudoku import is_valid_sudoku diff --git a/algorithms/map/longest_common_subsequence.py b/algorithms/map/longest_common_substring.py similarity index 100% rename from algorithms/map/longest_common_subsequence.py rename to algorithms/map/longest_common_substring.py