C++ easy solution with explaination
\nclass Solution {\npublic:\n    bool isMatch(string str, string pattern) {\n        int m=pattern.size();\n        int n=str.size();\n\n        bool dp[n+1][m+
```\nclass Solution {\npublic:\n    bool isMatch(string str, string pattern) {\n        int m=pattern.size();\n        int n=str.size();\n\n        bool dp[n+1][m+1];\n        for(int i=0;i<n+1;i++){\n            for(int j=0;j<m+1;j++){\n                dp[i][j]=false;\n            }\n        }\n        dp[0][0]=true;            //if both string and pattern are empty\n\n        for(int i=1;i<=m;i++){\n           if(pattern[i-1]==\'*\')  //if pattern starts with \'*\' \n           dp[0][i]=dp[0][i-1];\n        }\n        for(int i=1;i<n+1;i++){\n            for(int j=1;j<m+1;j++){\n                if(str[i-1]==pattern[j-1] || pattern[j-1]==\'?\') //if the character matches or it a ? so we can replace it with any character, then answer depends on dp[i-1][j-1]\n                dp[i][j]=dp[i-1][j-1];\n                else if(pattern[j-1]==\'*\') //if it is a * then either we can skip 1 character of str or pattern\n                dp[i][j]=dp[i-1][j] || dp[i][j-1];\n            }\n        }\n        return dp[n][m];\n    }\n};\n```
['Dynamic Programming', 'C']