Tilling problem 2 doubt

giving tle

Since the constraints are large, this problem is actually of dynamic programming and will give time limit exceed error for simple recursive approach. So i would suggest you to attempt this problem after covering dynamic programming lecture videos.

any other approach except dp?
cause in the hint video also recursive approach is given

No…here optimization can only be done by using DP/(saving states) since constraints are very large. Your recursive logic is correct and will give correct answers for small test cases but will give TLE for larger tc.