i m getting wrong test cases …please help me to find my mistakes on the code
Tiling problem recursion
Hey,
First of all using recursion would give u TLE, so u should go for DP
U still want to know how it is done using recursion Here is the code
If u wish to work it out using recursion, just use a for loop
for(int i = 1; i <= n ; i++){
if(i < m ) dp[i] = 1;
if(i == m) dp[i] = 2;
dp[i] = dp[i-m] + dp[i-1];
}
DONT forget to put MOD after every calculations
Hope it helps