Python DP with illustration
I had to look at other solutions for the top row, we set values to true until a non "*" character is found\n\nclass Solution:\n    def isMatch(self, s, p):\n   
I had to look at other solutions for the top row, we set values to true until a non "*" character is found\n```\nclass Solution:\n    def isMatch(self, s, p):\n        dp = [[False for _ in range(len(p)+1)] for i in range(len(s)+1)]\n        dp[0][0] = True\n        for j in range(1, len(p)+1):\n            if p[j-1] != \'*\':\n                break\n            dp[0][j] = True\n                \n        for i in range(1, len(s)+1):\n            for j in range(1, len(p)+1):\n                if p[j-1] in {s[i-1], \'?\'}:\n                    dp[i][j] = dp[i-1][j-1]\n                elif p[j-1] == \'*\':\n                    dp[i][j] = dp[i-1][j] or dp[i][j-1]\n        return dp[-1][-1]\n```\n![image](https://assets.leetcode.com/users/etherealoptimist/image_1552687196.png)\n
['Dynamic Programming', 'Python']