Not getting the test cases in Tiling Problem

Can you let me know what went wrong in my code, it is passing a single test case. Here is the link: https://ide.codingblocks.com/s/175298

@Codemaniac_Aditya 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.

Can you please check line number 24 of my code. I thought of it as a Dp solution.

@Codemaniac_Aditya Use the dp array arr as long long int type and then check. also change the data type of variable k and the return type of your tile function

No it didnt worked! Done everything you told…

Consider a case:
1
7 4

Expected o/p:
5
Your o/p:
3

Recheck your bases cases.

I have made some corrections and the output for 7 4 is now 5 , can you please check it once. Link: https://ide.codingblocks.com/s/175298

@Codemaniac_Aditya I have made some changes in your code. Check it now:

Yes, it has passed all the test cases thanks! however not getting the line
if(i<width)
arr[i]=arr[i-1]%MOD;

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.