can you help me with the code please
Doubt in tilling problem
i used dp to sole it can you help me with the code for recurssion
yeah i took refernce from other platforms
@adarshsingh2k dont copy the code blindly. The code that you submitted is using recursion with memoization, ie top-down DP.
can you just tell me simple approach and base case
for 2*3 we have two ways i.e. either horizontally or vertically
@adarshsingh2k
does this mean you did not even read the code you submitted?
The recurrance relation is:
f(n) = f(n-1) + f(n-m);
Read the code once and see the base conditions used there.
hey i read code and editorial both the reason i asked bcoz i am not able to get the base condition from code
These are the base conditions:
if (n < 1) return 0;
if (n == m) return 2;
if (n < m) return 1;
Recursive case:
return f(n-1, m) + f(n-m, m);
what is memoization can you tell please
@adarshsingh2k it is a technique used to remember the answers that have already been calculated to avoid calculating the same thing again and again. I would recommend you to watch the initial lectures on DP to get a better idea.
is there any other way to solve it
is it explained in dp section
i am asking about tilling problem
hey did you delete my messages
