Memoization works when I mark my dp array with 0 but fails to work when I mark it with -1. Why?
hello @anshufirefox
it will work with -1 as well.
can u show me how u are intitlaising ur dp array with -1?
int dp[some value]={-1}, is it the wrong way?
Did it using a loop, works with -1 as well. Thank you
…
yeah it wrong…
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.