C++ beats 100%
C++ beats 100%\n\n\n\n# Code\n\nclass Solution {\npublic:\n    bool isMatch(string s, string p) {\n        int m = s.length(), n = p.length();\n        int i = 
C++ beats 100%\n![image.png](https://assets.leetcode.com/users/images/a8cfc2aa-a53a-475e-a91b-73b9503b032f_1715684712.5217242.png)\n\n\n# Code\n```\nclass Solution {\npublic:\n    bool isMatch(string s, string p) {\n        int m = s.length(), n = p.length();\n        int i = 0, j = 0, asterick = -1, match;\n        while (i < m) {\n            if (j < n && p[j] == \'*\') {\n                match = i;  \n                asterick = j++;\n            }\n            else if (j < n && (s[i] == p[j] || p[j] == \'?\')) {\n                i++;\n                j++;\n            }\n            else if (asterick >= 0) {\n                i = ++match;\n                j = asterick + 1;\n            }\n            else return false;\n        }\n        while (j < n && p[j] == \'*\') j++;\n        return j == n;\n    }\n};\n```
['C++']