No outputs for testcases

Getting output for custom inputs but not getting output for testcase.

@itsmeshubhamkumar hey shubham this method will not work for large input try your implementation with the dynamic programming concepts hint bottom up approach.

but it is given under recursion challenges

@itsmeshubhamkumar
The constraints mentioned in this problem are a bit tight and hence you will not be able to solve this problem completely using just recursion. You need to optimise your approach , which is where Dynammic Programming comes in. Try optimising your solution using DP. If you have only covered the recursion section and not reached till DP in your course , I suggest you to leave this problem for now and come back to it when you cover DP. Since your recursive approach seems right , you have already got the most part . Adding Memoization ( DP technique ) to your code would be easy for you later.

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.