Timelimit error

1 test case is passed and rest all gives time limit error.
LINK - https://ide.codingblocks.com/s/202442

@vmanav
hello manav,
your solution time complexity is high thats why u r getting tle. use dynamic programming to optimse ur solution.

Its a challenge for RECURSION, how am i supposed to use dynamic programming its way ahead in the course…

@vmanav
ok then try this once u get familar with dp.

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.