Tilling Problem - II

I’m getting TLE
Help me with the better logic (does memoization help??)

Code link: https://ide.codingblocks.com/s/126516

@raj.bmp.333 hey rishav this question require a dp approach if you’re about to reach dp problem then try out solving this else skip for now…

Is my approach correct for smaller inputs because I’m getting one test case accepted.

Is there a flaw in logic or just optimization is required??

@raj.bmp.333 optimization is required.

I am trying to do memoization for recusive calls Link: https://ide.codingblocks.com/s/126562

@raj.bmp.333 use bottom up approach it would eaiser