My java DP solution
a shorter version\n\npublic class Solution {\n    \n    public boolean isMatch(String s, String p) {\n        if (p.replace("", "").length() > s.length())\n    
a shorter version\n\npublic class Solution {\n    \n    public boolean isMatch(String s, String p) {\n        if (p.replace("*", "").length() > s.length())\n            return false;\n\t\tboolean[] d = new boolean[s.length() + 1];\n\t\td[0] = true;\n\t\tfor (int i = 1; i < s.length(); ++i) {\n\t\t\td[i] = false;\n\t\t}\n\t\tfor (int i = 1; i <= p.length(); ++i) {\n\t\t\tchar pchar = p.charAt(i - 1);\n\t\t\tif (pchar == '*') {\n\t\t\t\tfor (int j = 1; j <= s.length(); ++j) {\n\t\t\t\t\td[j] = d[j - 1] || d[j];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfor (int j = s.length(); j >= 1; --j) {\n\t\t\t\t\td[j] = d[j - 1] && (pchar == '?' || pchar == s.charAt(j - 1));\n\t\t\t\t}\n\t\t\t}\n\t\t\td[0] = d[0] && pchar == '*';\n\t\t}\n\t\treturn d[s.length()];\n    }\n}
['Java']