Python DP solution
\ndef minDistance(self, word1, word2):\n        """\n        :type word1: str\n        :type word2: str\n        :rtype: int\n        """\n        m = len(word1
```\ndef minDistance(self, word1, word2):\n        """\n        :type word1: str\n        :type word2: str\n        :rtype: int\n        """\n        m = len(word1)\n        n = len(word2)\n        dp = [[0 for i in range(n+1)] for j in range(m+1)]\n        for i in range(m+1):\n            for j in range(n+1):\n                if i== 0:\n                    dp[i][j] = j\n                elif j == 0:\n                    dp[i][j] = i\n                elif word1[i-1] == word2[j-1]:\n                    dp[i][j] = dp[i-1][j-1]\n                else:\n                    dp[i][j] = 1 + min(dp[i][j-1], dp[i-1][j], dp[i-1][j-1])\n        return dp[m][n]   \n```
[]