Dynamic Programming
Linear DP

10. Regular Expression Matching
dp[i][j] indicates if s(0,i-1) matches p(0,j-1)
Base case: s empty, p empty → True; s empty, p xx type → True Compare s[i], p[j]: if not match and p[j] is *, and s[i] matches p[j-1], three possibilities: match one letter, zero letters, multiple letters. If not match and p[j] is *, and s[i] doesn’t match p[j-1], check zero letter option.

