edit distance DP (sequence alignment)