mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-17 14:58:10 +00:00
Fix possible error in longest_common_subsequence.py (#1163)
The comparison at line 53 was not checking if (j > 0).
This commit is contained in:
parent
d327f10702
commit
d4151bd516
|
@ -50,7 +50,7 @@ def longest_common_subsequence(x: str, y: str):
|
|||
|
||||
seq = ""
|
||||
i, j = m, n
|
||||
while i > 0 and i > 0:
|
||||
while i > 0 and j > 0:
|
||||
if x[i - 1] == y[j - 1]:
|
||||
match = 1
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user