C++ || MEMIZATION
Code\n\nclass Solution {\npublic:\n    int solve(int i,int j,int &a,int &b,string &s,string &p,vector<vector<int>> &dp){\n        if(i==a && j==b)return 1;\n   
# Code\n```\nclass Solution {\npublic:\n    int solve(int i,int j,int &a,int &b,string &s,string &p,vector<vector<int>> &dp){\n        if(i==a && j==b)return 1;\n        else if(i==a){\n            while(j<b && p[j]==\'*\')j++;\n            return j==b;\n        }\n        else if(i != a && j == b)return 0;\n        if(dp[i][j] != -1)return dp[i][j];\n        bool c = false;\n        while(j<b && p[j]==\'*\'){j++;c = true;}\n        \n        if(c)j--;\n        if(p[j]==\'?\'){\n            dp[i][j] = solve(i+1,j+1,a,b,s,p,dp);\n        }else if(p[j]==\'*\'){\n            dp[i][j] = solve(i+1,j,a,b,s,p,dp)||solve(i,j+1,a,b,s,p,dp);\n        }else{\n            if(s[i]==p[j]){\n                dp[i][j] = solve(i+1,j+1,a,b,s,p,dp);\n            }else{\n                dp[i][j] = 0;\n            }\n        }\n        return dp[i][j];\n    }\n    bool isMatch(string s, string p) {\n        int a = s.length(),b= p.length();\n        vector<vector<int>> dp(a,vector<int>(b,-1));\n        return solve(0,0,a,b,s,p,dp);\n    }\n};\n```
['C++']