Though i am getting all test case correct but i thing this might not be the way to implement dp in this…
please help whether it correct way or it should have been something else
Though i am getting all test case correct but i thing this might not be the way to implement dp in this…
please help whether it correct way or it should have been something else
@Ram_Vilash_Kumar, you have formed correct recursive solution and memoized it . another way would be to apply dp using tabular form (bottom up approach)
u can refer this link i have explained with comments : - https://ide.codingblocks.com/s/241414
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.