EditDistance suffixbased, prefixbased, simplify logic add boundary values