Simple recursive solution
Approach\n\nWe first handle the edge case that s1 or s2 is empty. If the first letters of both strings match, we calculate the minimum distance over the remaind
# Approach\n\nWe first handle the edge case that `s1` or `s2` is empty. If the first letters of both strings match, we calculate the minimum distance over the remainder of the strings. Otherwise, we return one more than the minimum of the insertion, removal, and replacement distances.\n\n# Code\n\n```python\nclass Solution:\n    @cache\n    def minDistance(self, s1: str, s2: str) -> int:\n        if s1 == "" or s2 == "":\n            return len(s1 + s2)\n        elif s1[0] == s2[0]:\n            return self.minDistance(s1[1:], s2[1:])\n        else:\n            return 1 + min(\n                self.minDistance(s1, s2[1:]),  # insert\n                self.minDistance(s1[1:], s2),  # remove\n                self.minDistance(s1[1:], s2[1:]),  # replace\n            )\n```
['Recursion', 'Python3']