AlgoFrames

Identify the state

Warm-up · Multiple choice · about 3 min

Min cost climbing stairs: leaving step i costs cost[i], a move climbs 1 or 2 steps, and you may start on step 0 or step 1. You want the cheapest way to reach the top.

Which meaning of dp[i] is a good state?

Learn the idea first: The DP recipe: state, transition, base cases, order, answer, a visual lesson.

More The DP recipe: state, transition, base cases, order, answer problems