reorg and add code for second edition

This commit is contained in:
Aditya Bhargava
2023-08-09 08:20:19 -05:00
parent 9306432a1b
commit 933acafaf3
89 changed files with 18 additions and 117 deletions

View File

@@ -0,0 +1,12 @@
# `cell` is a map of maps here, e.g.
# cell = %{
# 0 => %{0 => 0, ...},
# 1 => %{...},
# ...
# }
if String.at(word_a, i) == String.at(word_a, j) do
put_in(cell[i - 1][j - 1], cell[i - 1][j - 1] + 1)
else
put_in(cell[i - 1][j - 1], max(cell[i - 1][j], cell[i][j - 1]))
end