code for chapter 9 in javascript

This commit is contained in:
Kevin Nguyen
2016-06-21 21:50:04 -07:00
parent 4a98a14bc1
commit 8181b2609f

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] = Math.max(cell[i-1][j], cell[i][j-1]);
}