Using DP(Dynamic Programming) algorithm to calculate string edit distance