A straightforward solution [Python, faster than 98.6%]
The idea is to find the recursive relation. \n\nIf s1[i] == s2[j], then f(i, j) = f(i - 1, j - 1)\nOtherwise, \n    f(i, j) = min(1 + f(i, j - 1), 1 + f(i - 1, 
The idea is to find the recursive relation. \n\nIf `s1[i] == s2[j]`, then `f(i, j) = f(i - 1, j - 1)`\nOtherwise, \n    `f(i, j) = min(1 + f(i, j - 1), 1 + f(i - 1, j), 1 + f(i - 1, j - 1))`\nwhich corresponds to insert, delete and replace.\n\n```\nclass Solution:\n    def minDistance(self, s1: str, s2: str) -> int:\n\n        @lru_cache(maxsize=None)\n        def f(i, j):\n            if i == 0 and j == 0: return 0\n            if i == 0 or j == 0: return i or j\n            if s1[i - 1] == s2[j - 1]:\n                return f(i - 1, j - 1)\n            return min(1 + f(i, j - 1), 1 + f(i - 1, j), 1 + f(i - 1, j - 1))\n\n        m, n = len(s1), len(s2)\n        return f(m, n)\n```
['Recursion', 'Memoization', 'Python', 'Python3']