Adapting the recurrence
Open answerFor the staircase, you could advance by 1 or 2 stairs. If you could also advance by 3 stairs at once, how would the recurrence formula dp[i] = dp[i-1] + dp[i-2] need to be modified?
For the staircase, you could advance by 1 or 2 stairs. If you could also advance by 3 stairs at once, how would the recurrence formula dp[i] = dp[i-1] + dp[i-2] need to be modified?