Tiling problem 2

SHOWING TLE IN test cases ???
problem in my code ??

hello @hg11110000
the recursive solution has exponential time complexity thats why u r getting tle .

so to improve the time complexity use dynamic programming

@aman212yadav

otherwise its correct ?? via recursion ??? i have done correct ??

DP is afterwards…recursion section if before…thats why

yeah ur code is correct and will work fine for small cases.

@aman212yadav
how is the dp working here can u please explain … saw the tutorial but didn’t got

spend some more time on dp basics , learn about optimal substructure and overlapping subproblems then only the tutorial will make any sense.

if u have started learning dp then i would recommend to watch that fibonnaci problem. that covers almost everything