Tiling - problem

time limit exceeded problem
how can i optimise my code.
https://ide.codingblocks.com/s/56022

Hi Kiran, please share the link of the question.

Hi Kiran, as you can see there will be too many Recursive calls for larger input, so try using dynamic programming here. U can use this as:

count(n) = {
1, 1 < = n < m ,
2, n = m ,
count(n-1) + count(n-m), m < n
}

This is a bottom down DP approach.

Pls try the question again now.

Hey Kiran, 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.