C++ Easy DP Solution (Well Commented )
\nint minDistance(string word1, string word2) {\n// Create a table to store results of subproblems\n        int dp[word1.size()+1][word2.size()+1];\n// If first
```\nint minDistance(string word1, string word2) {\n// Create a table to store results of subproblems\n        int dp[word1.size()+1][word2.size()+1];\n// If first string is empty, only option is to \n// insert all characters of second string \n        for(int k=0; k<=word1.size(); k++)\n            dp[k][0] = k;\n// If second string is empty, only option is to \n// remove all characters of first string\n        for(int k=0; k<=word2.size(); k++)\n            dp[0][k] = k;\n// Fill dp[][] in bottom up manner \n        for(int i=1; i<=word1.size(); i++){\n            for(int j=1; j<=word2.size(); j++){\n//if characters at current position in 2 strings are equal\n//there will be no new operation so copy value from previous position\n                if(word1[i-1] == word2[j-1])\n                    dp[i][j] = dp[i-1][j-1];\n// If the last character is different, consider all \n// possibilities and find the minimum\n                else\n                    dp[i][j] = 1 + min({dp[i][j - 1], // Insert \n                                   dp[i - 1][j], // Remove \n                                   dp[i - 1][j - 1]}); // Replace \n            }\n        }\n        \n        return dp[word1.size()][word2.size()];\n    }\n```\n**Upvotes are encouraging**
[]