@@ -0,0 +1,842 @@
+public class Solution %7B%0A    /**%0A     * @param word1: A string%0A     * @param word2: A string%0A     * @return: The minimum number of steps.%0A     */%0A    public int minDistance(String word1, String word2) %7B%0A        int n = word1.length();%0A        int m = word2.length();%0A        %0A        int%5B%5D%5B%5D dp = new int%5Bn+1%5D%5Bm+1%5D;%0A        for(int i=0; i%3C m+1; i++)%7B%0A            dp%5B0%5D%5Bi%5D = i; %0A        %7D%0A        for(int i=0; i%3Cn+1; i++)%7B%0A            dp%5Bi%5D%5B0%5D = i;%0A        %7D%0A        %0A        %0A        for(int i = 1; i%3Cn+1; i++)%7B%0A            for(int j=1; j%3Cm+1; j++)%7B%0A                if(word1.charAt(i-1) == word2.charAt(j-1))%7B%0A                    dp%5Bi%5D%5Bj%5D = dp%5Bi-1%5D%5Bj-1%5D;%0A                %7Delse%7B%0A                    dp%5Bi%5D%5Bj%5D = 1 + Math.min(dp%5Bi-1%5D%5Bj-1%5D,Math.min(dp%5Bi-1%5D%5Bj%5D,dp%5Bi%5D%5Bj-1%5D));%0A                %7D%0A            %7D%0A        %7D%0A        return dp%5Bn%5D%5Bm%5D;%0A    %7D%0A%7D

add 119