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:
Rwithik Manoj 2019-08-31 17:10:50 +05:30 committed by Christian Clauss
parent d327f10702
commit d4151bd516

View File

@ -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: