Dynamic Programming, Facebook Coding Interview, Google Coding Interview, Coding Interviews, Java.
whether s.substring(0,i) matches with p.substring(0,j). It contains boolean value. dp[0][0] = true dp[0][j] = dp[0][j-2] if p[j-1] == '*' i = 1 to s.length j = 1 to p.length dp[i][j] = dp[i-1][j-1] if s[i] == p[j] or p[j] == '.' dp[i][j-2] || (dp[i-1][j] && (s[i] == p[j-1] or p[j-1] == '.')) if