标签:distance 0ms leetcode word 距离 color desc 编辑 script
https://leetcode.com/problems/edit-distance/?tab=Description
真的非常好,也非常典型。
https://discuss.leetcode.com/topic/17639/20ms-detailed-explained-c-solutions-o-n-space
dp[i][0] = i; dp[0][j] = j; dp[i][j] = dp[i - 1][j - 1], if word1[i - 1] = word2[j - 1]; dp[i][j] = min(dp[i - 1][j - 1] + 1, dp[i - 1][j] + 1, dp[i][j - 1] + 1), otherwise.
标签:distance 0ms leetcode word 距离 color desc 编辑 script
原文地址:http://www.cnblogs.com/charlesblc/p/6443262.html