code for chapter 9

This commit is contained in:
Aditya Bhargava
2016-03-02 15:11:32 -08:00
parent 26aa694fbc
commit 2a01a0f546

View File

@@ -0,0 +1,6 @@
if word_a[i] == word_b[j]:
# The letters match.
cell[i][j] = cell[i-1][j-1] + 1
else:
# The letters don't match.
cell[i][j] = max(cell[i-1][j], cell[i][j-1])