Tilling Problem - timelimit reached - java

Testcase 1 , 3,4,5 timelimit reached. code with dynamic approach - https://ide.codingblocks.com/s/161358 recursive program - https://ide.codingblocks.com/s/161359 Let me know if there’s problem with the dynamic approach or perhaps with the recursive approach itself.

Dynamic Programming Approach.

Can you give some more hint I can’t really figure out.

Maybe because of not using FAST input output. Use fast input output.

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.