[Python] DFS with Memoization - Clean & Concise
python\nclass Solution:\n    def isMatch(self, s: str, p: str) -> bool:\n        @lru_cache(None)\n        def dfs(i, j):\n            if j == len(p):  # Reach 
```python\nclass Solution:\n    def isMatch(self, s: str, p: str) -> bool:\n        @lru_cache(None)\n        def dfs(i, j):\n            if j == len(p):  # Reach full pattern\n                return i == len(s)\n\n            if i < len(s) and (s[i] == p[j] or p[j] == \'?\'):  # Match Single character\n                return dfs(i + 1, j + 1)\n            \n            if p[j] == \'*\':\n                return dfs(i, j + 1) or i < len(s) and dfs(i + 1, j)  # Match zero or one or more character\n            \n            return False\n\n        return dfs(0, 0)\n```\nComplexity:\n- Time: `O(M * N)`, where `M <= 2000` is the length of string `s`, `N <= 2000` is the length of string `t`.\n- Space: `O(M * N)`
[]