- dp[i][j], dp[0][0] = True
- if s[i] == p[j]: dp[i][j] = dp[i-1][j-1]
- if p[i] == ".": dp[i][j] = dp[i-1][j-1]
- if p[i] == "*":
- if p[j-1] != s[i]: dp[i][j] = dp[i][j-2]
- if p[j-1] == s[i] or p[j-1] == ".": dp[i][j] = (dp[i]p[j-1] or dp[i-1][j] or dp[i][j-2])