Tilling problem showing wrong answer

https://ide.codingblocks.com/s/67485
is my logic correct ? Please check the code

@Anshumanchaursiya Please try with memoization in your code. It means you can store the ans of a subproblem the first time you solve it and then use the same ans when you encounter that subproblem instead of solving it again.
This will optimize time-complexity of your code.

I want to know whether my logic is correct or not if i do not consider time limit

@Anshumanchaursiya hey anshuman your recurrence relation is not right

Hey Anshuman,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.