746. Min Cost Climbing Stairs
题目描述
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).
Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of the floor, and you can either start from the step with index 0, or the step with index 1.
|
|
|
|
题目大意
上楼梯,可以走一步也可以走两步,每一级台阶都是需要付出代价的,求花最少代价上楼梯。
解题思路
动态规划
代码
|
|