Test case not working for my dp solution


#1

`int Solution::isMatch(const string A, const string B){
int n = A.length(), m = B.length();
vector<vector > dp(n+1, vector (m+1,false));
dp[0][0] = true;
for (int i = 0;i<m+1;i++){
if (A[i-1]==’*’){
dp[0][i]= dp[0][i-2];
}
}

for (int i = 1;i<n+1;i++){
    for (int j = 1;j<m+1;j++){

        if ((B[j-1] == '.')|| (B[j-1] ==A[i-1])){
            dp[i][j] = dp[i-1][j-1];
            // cout<<"123";
        }
        else if (B[j-1]=='*'){
            dp[i][j] = dp[i][j-2];
            if ((B[j-2] =='.') || (B[j-2] == A[i-1])){
                dp[i][j] = (dp[i][j] || dp[i-1][j]);
            }
        }
        else{
            dp[i][j] = false;
        }
    }
}
return dp[n][m];

}`

test case was
A : “efwihfioghih35i”
B : “.*”

and my output was 0 instead of 1