edit distance
use memo class
ternary search