Question DSA-DP-0014
MediumWhat is the output of this code?
r, c = 3, 3
dp = [[1] * c for _ in range(r)]
for i in range(1, r):
for j in range(1, c):
dp[i][j] = dp[i-1][j] + dp[i][j-1]
print(dp[-1][-1])
- A.
4
- B.
3
- C.
Sign up free to see the answer and a step-by-step explanation.