C++ code (9ms) beats 100% persons!
\n```\nclass Solution {\npublic:\n    bool isMatch(string s, string p) {\n        int n=s.length(), m=p.length();\n        int pid=0, sid=0;\n        int pidp=-
\n```\nclass Solution {\npublic:\n    bool isMatch(string s, string p) {\n        int n=s.length(), m=p.length();\n        int pid=0, sid=0;\n        int pidp=-1, sidp=-1;\n        while(sid<n){\n            if(p[pid]==s[sid] || p[pid]=='?'){\n                pid++; sid++;\n            }else if(p[pid]=='*'){\n                pidp=pid++; sidp=sid;\n            }else{\n                if(pidp>-1){\n                    pid=pidp+1; sid=++sidp;\n                }else{\n                    return false;\n                }\n            }\n        }\n        while(p[pid]=='*') pid++;\n        return pid==m;\n    }\n};\n````
[]