C++ recursive solution, 16 ms
class Solution {\n        // return value:\n        // 0: reach the end of s but unmatched\n        // 1: unmatched without reaching the end of s\n        // 2:
    class Solution {\n        // return value:\n        // 0: reach the end of s but unmatched\n        // 1: unmatched without reaching the end of s\n        // 2: matched\n        int dfs(string& s, string& p, int si, int pi) {\n            if (si == s.size() and pi == p.size()) return 2;\n            if (si == s.size() and p[pi] != '*') return 0;\n            if (pi == p.size()) return 1;\n            if (p[pi] == '*') {\n                if (pi+1 < p.size() and p[pi+1] == '*') \n                    return dfs(s, p, si, pi+1); // skip duplicate '*'\n                for(int i = 0; i <= s.size()-si; ++i) {\n                    int ret = dfs(s, p, si+i, pi+1);\n                    if (ret == 0 or ret == 2) return ret; \n                }\n            }\n            if (p[pi] == '?' or s[si] == p[pi])\n                return dfs(s, p, si+1, pi+1);\n            return 1;\n        }    \n        \n    public:\n        bool isMatch(string s, string p) {\n            return dfs(s, p, 0, 0) > 1;\n        }\n    };
['Recursion', 'C++']