dp very intuitive with no bullshit for interviews more simpler than most voted
\tpublic boolean isMatch(String s, String p) {\n\t\tboolean[][] dp = new boolean[s.length() + 1][p.length() + 1];\n\t\tdp[0][0] = true;\n\n\t\tfor (int i = 1; i
\tpublic boolean isMatch(String s, String p) {\n\t\tboolean[][] dp = new boolean[s.length() + 1][p.length() + 1];\n\t\tdp[0][0] = true;\n\n\t\tfor (int i = 1; i <= p.length(); i++) {\n\t\t  if (p.charAt(i - 1) == \'*\') {\n\t\t\tdp[0][i] = dp[0][i - 1];\n\t\t  }\n\t\t}\n\n\t\tfor (int i = 1; i <= s.length(); i++) {\n\t\t  for (int j = 1; j <= p.length(); j++) {\n\t\t\tchar sch = s.charAt(i - 1);\n\t\t\tchar pch = p.charAt(j - 1);\n\n\t\t\tif (sch == pch || pch == \'?\') {\n\t\t\t  dp[i][j] = dp[i - 1][j - 1];\n\t\t\t} else if (pch == \'*\') {\n\t\t\t  dp[i][j] = dp[i - 1][j - 1] || dp[i][j - 1] || dp[i - 1][j];\n\t\t\t}\n\t\t  }\n\t\t}\n\n\t\treturn dp[s.length()][p.length()];\n\t  }
['Dynamic Programming']