Skip to content

Commit 9fa8a3f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 31b9d64 commit 9fa8a3f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

strings/longest_common_subsequence.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# This program finds the Longest Common Subsequence (LCS) between two strings
33
# using Dynamic Programming and also prints the actual LCS string.
44

5+
56
def longest_common_subsequence(X: str, Y: str):
67
m, n = len(X), len(Y)
78
dp = [[0] * (n + 1) for _ in range(m + 1)]
@@ -28,7 +29,7 @@ def longest_common_subsequence(X: str, Y: str):
2829
j -= 1
2930

3031
lcs.reverse()
31-
lcs_str = ''.join(lcs)
32+
lcs_str = "".join(lcs)
3233

3334
# Print DP table (for visualization)
3435
print("DP Table:")

0 commit comments

Comments
 (0)