Tiling problem-2

code:https://ide.codingblocks.com/s/247883
ques:https://online.codingblocks.com/app/player/74266/content/76599/5208/code-challenge
what is wrong??

hello @bhaskar0_0
check output format ,u are asked to take modulo and then print answer.

also u mod property while peforming summation.
(a+b)%mod=(a%mod+b%mod)%mod;

still the same problem have i done it right?
code:https://ide.codingblocks.com/s/247883

LOGIC IS COORECT.
apply mod property here as well
image
it should be
ll ans = (topdown(n-1,m,dp)%mod+topdown(n-m,m,dp)%mod)%mod;

still giving run error in 2 cases

pls share ur updated code with me.
using cb ide

make ur dp array global.

ur updated code->

Should i always make the the dp array global?what is wrong with making it local here?btw thanks for helping

global scope has higher memory capacity than function scope , that whys many time declaring array global solves the problem.
genrally if memory required is high then we declare it global.