@@ -0,0 +1,953 @@
+public class Solution %7B%0A    public int minDistance(String word1, String word2) %7B%0A        int lenOne = word1.length();%0A        int lenTwo = word2.length();%0A%0A        if(lenOne == 0 %7C%7C lenTwo == 0)%7B%0A        %09return lenTwo == 0? lenOne : lenTwo;%0A        %7D%0A%0A        int%5B%5D%5B%5D dis = new int%5BlenOne + 1%5D%5BlenTwo + 1%5D;%0A%0A        for(int i = 0; i %3C= lenOne; i++)%7B%0A        %09dis%5Bi%5D%5B0%5D = i;%0A        %7D%0A%0A        for(int j = 0; j %3C= lenTwo; j++)%7B%0A        %09dis%5B0%5D%5Bj%5D = j;%0A        %7D%0A%0A        for(int i = 1; i %3C= lenOne; i++)%7B%0A        %09for(int j = 1; j %3C= lenTwo; j++)%7B%0A        %09%09if(word1.charAt(i - 1) == word2.charAt(j - 1))%7B%0A        %09%09%09dis%5Bi%5D%5Bj%5D = dis%5Bi - 1%5D%5Bj - 1%5D;%0A        %09%09%7Delse%7B%0A        %09%09%09int op1 = dis%5Bi - 1%5D%5Bj%5D + 1;%0A        %09%09%09int op2 = dis%5Bi%5D%5Bj - 1%5D + 1;%0A        %09%09%09int replace = dis%5Bi - 1%5D%5Bj - 1%5D + 1;%0A        %09%09%09dis%5Bi%5D%5Bj%5D = op1 %3C op2? Math.min(op1, replace) : Math.min(op2, replace);%0A        %09%09%7D%0A        %09%7D%0A        %7D%0A%0A        return dis%5BlenOne%5D%5BlenTwo%5D;%0A    %7D%0A%7D

add edit distance solution