Please Help geeting MLE with this code


#1

int solve(string A, string B){
int a = A.size();
int b = B.size();
vector<vector> dp(a + 1, vector(b + 1));
dp[0][0] = 1;
//i for a
//j for b

for(int i = 0; i <= a; i++){
    for(int j = 0; j <= b; j++){
        if(i == 0 && j == 0){
            dp[i][j] = 1;
        }
        else if(j == 0 && i != 0){
            dp[i][j] = 0;
        }
        else if(i == 0 && B[j - 1] != '*'){
            dp[i][j] = 0;
        }
        else if(i == 0 && B[j - 1] == '*'){
            dp[i][j] = dp[i][j - 1];
        }
        else if(A[i - 1] == B[j - 1]){
            dp[i][j] = dp[i - 1][j - 1];
        }
        else if(B[j - 1] == '?'){
            dp[i][j] = dp[i - 1][j - 1];
        }
        else if(B[j - 1] == '*'){
            dp[i][j] = dp[i - 1][j] || dp[i][j - 1];
        }
        else{
            dp[i][j] = 0;
        }
    }
}
return dp[a][b];

}