Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Let dp[i][j] be the number of people who have known the secret for exactly j + 1 days, at day i.
If j > 0, dp[i][j] = dp[i – 1][j – 1].
dp[i][0] = sum(dp[i – 1][j]) for j in [delay – 1, forget – 2].