My code is able to generate same answers but cant pass test cases

Hello @sid.rajput23 in this question you have to use the concept of dynammic programming:

so if you have not studied about the dynammic programming yet then you can leave this question till you reach dynammic programming:

okay sir but it is giving same outputs ?

@sid.rajput23 yes for small test cases you will get the same correct ouput but for large test cases it will reevaluate for the smaller test cases again and again that is why it is not able to pass the test cases:

okay sir i will try it later after DP

@sid.rajput23 yes if then you face the same error then you can raise the doubt again.

1 Like

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.