TLE in last 3 test cases

Used dp still getting TLE, please debug this code.

Hi @ksalokya
so basically ur code is absolutely correct… but there is some compiler issues thats why bottom up approach is not passing all test cases… even my code which i submitted on leetcode is failing last 3 test cases… but top down approach is passing all test cases…
so maybe try submitting that soln…

alright thanks a lot…

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.