mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
psf/black code formatting (#1277)
This commit is contained in:

committed by
Christian Clauss

parent
07f04a2e55
commit
9eac17a408
@ -41,12 +41,12 @@ def longest_common_subsequence(x: str, y: str):
|
||||
|
||||
for i in range(1, m + 1):
|
||||
for j in range(1, n + 1):
|
||||
if x[i-1] == y[j-1]:
|
||||
if x[i - 1] == y[j - 1]:
|
||||
match = 1
|
||||
else:
|
||||
match = 0
|
||||
|
||||
L[i][j] = max(L[i-1][j], L[i][j-1], L[i-1][j-1] + match)
|
||||
L[i][j] = max(L[i - 1][j], L[i][j - 1], L[i - 1][j - 1] + match)
|
||||
|
||||
seq = ""
|
||||
i, j = m, n
|
||||
@ -69,9 +69,9 @@ def longest_common_subsequence(x: str, y: str):
|
||||
return L[m][n], seq
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
a = 'AGGTAB'
|
||||
b = 'GXTXAYB'
|
||||
if __name__ == "__main__":
|
||||
a = "AGGTAB"
|
||||
b = "GXTXAYB"
|
||||
expected_ln = 4
|
||||
expected_subseq = "GTAB"
|
||||
|
||||
|
Reference in New Issue
Block a user