Wrong outputs for the problem


the testcases are returning these values, These are wrong answers I guess, I request admins to update the solution.

int Solution::solve(string A, string B) {
int count=0,m=A.size(),n=B.size();
vector<vector >dp(m+1,vector(n+1,0));
for(int i=0;i<=m;i++)dp[i][0]=1;
for(int i=1;i<=m;i++){
bool present=0;
for(int j=1;j<=n;j++){
else if(dp[i-1][j])dp[i][j]=1;
if(dp[m][n]!=1) return 0; //because no subsequence equals to string B
return count;

This is my solution, please correct me if any mistakes