Min Cost Climbing Stairs
You are given an integer array cost where cost[i] is the cost of the i-th step on a staircase. Once you pay the cost of a step, you can climb either one or two steps from it.
You may start from the step at index 0 or the step at index 1, and starting is free. Return the minimum cost to reach the top of the floor, which is the position one past the last index.
cost = [10, 15, 20]
15
Start at index 1, pay 15, and climb two steps to land past the end. Starting at index 0 instead would cost at least 10 + 15 or 10 + 20.
cost = [1, 100, 1, 1, 1, 100, 1, 1, 100, 1]
6
Start at index 0 and pay at indices 0, 2, 4, 6, 7, and 9, each costing 1, stepping over both 100s. The total is 6.
2 <= cost.length <= 10000 <= cost[i] <= 999