i have done it using recursion + memoisation , but can you explain the bottom up appraoch ??
Bottom up approach
@Muskan-Gupta-598128740703036,
It is pretty much the same thing, rather than directly jumping onto the solution, let’s bottom-up (pun intended) towards the bottom up intuition. For starter hint, the state of the dp will be quite similar in both bottom up and top down, just try to think in opposite direction per say.
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.