📌 Python3 solution using DP-top down approach
\nclass Solution:\n    def minDistance(self, word1: str, word2: str) -> int:\n        dp = {}\n        \n        def getResult(i,j):\n            if i == len(wo
```\nclass Solution:\n    def minDistance(self, word1: str, word2: str) -> int:\n        dp = {}\n        \n        def getResult(i,j):\n            if i == len(word1) and j == len(word2):\n                return 0\n            if i == len(word1):\n                return len(word2) - j\n            if j == len(word2):\n                return len(word1) - i\n\n            if (i, j) not in dp:\n                if word1[i] == word2[j]:\n                    ans = getResult(i + 1, j + 1)\n                else: \n                    insert = 1 + getResult(i, j + 1)\n                    delete = 1 + getResult(i + 1, j)\n                    replace = 1 + getResult(i + 1, j + 1)\n                    ans = min(insert, delete, replace)\n                dp[(i, j)] = ans\n            return dp[(i, j)]\n        \n        return getResult(0,0)\n```
['Recursion', 'Memoization', 'Python3']