128ms O(1) space python solution
class Solution:\n        # @param {string} s\n        # @param {string} p\n        # @return {boolean}\n        def isMatch(self, s, p):\n            if not p:\
    class Solution:\n        # @param {string} s\n        # @param {string} p\n        # @return {boolean}\n        def isMatch(self, s, p):\n            if not p:\n                return not s\n    \n            m, n = len(s), len(p)\n            i = j = 0\n            last_x = 0\n            last_y = -1\n            while i < m:\n                if j < n and (p[j] == '?' or p[j] == s[i]):\n                    i += 1\n                    j += 1\n                elif j < n and p[j] == '*':\n                    last_x = i\n                    last_y = j\n                    j += 1\n                elif last_y >= 0:\n                    i = last_x + 1\n                    last_x += 1\n                    j = last_y\n                else:\n                    return False\n            \n            while j < n and p[j] == '*':\n                j += 1\n\n            return j == n
[]