Min Cost Climbing Stairs
EasyLeetCode1-D Dynamic Programming
Approach hintTry it first, then revealHide
Let dp[i] be the cheapest way to stand on step i: you arrive from i - 1 or i - 2 after paying that step's cost. The top is index n, one past the last step.