Why Wild card pattern matching giving run error in last test case ? [dp]

link: https://ide.codingblocks.com/s/238542

Hey @dhruv.160410116084
You have used 2D dp
It needs to be done using 1D DP
There is a way to make it work with a 1D array
You can find it on GFG
Your code is failing due to memory overflow of 2D array

i unlocked editorial and it also used same 2d array approach.

@dhruv.160410116084
It did but it will work only for small value of r and c
So try to use the 1D DP solution or you may submit the editorial solution and move on since you understand the logic

i want to point out that editorial also has same error , please update the editorial.

@dhruv.160410116084
Yes I understand that
After I recommended the solution to you I sent an update to the team to update the editorial
Thank you again for pointing it out

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.