code for chapter 9 in ruby

This commit is contained in:
Leon Rische
2016-03-03 16:17:37 +01:00
parent 58b026e7b8
commit 7a2d6d8d77

View File

@@ -0,0 +1,7 @@
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] = [cell[i-1][j], cell[i][j-1]].max
end