Please check out this code


what’s the problem with this code

@aryan

  1. why are you maintaining cnt variable. There is not need to use it. Simply change line 10 to if(i == n and j == m)return dp[i][j]=1;
  2. line 14 and 16 is not required. Comment out them
  3. change line 17 to if(dp[i][j])return dp[i][j];
  4. add modulo in line 15 too.

@aryan
here is the updated code : https://ide.codingblocks.com/s/280820

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.