Cheapest way up the stairs
cost lists the price of stepping on each stair. You may start on stair 0 or stair 1 and
climb one or two stairs at a time; you finish when you step past the last stair. Write
min_cost(cost) that returns the cheapest total.
min_cost([10, 15, 20]) -> 15
min_cost([1, 100, 1, 1, 1, 100, 1, 1, 100, 1]) -> 6
The point is to practise a DP whose subproblem is "cheapest way to reach stair i".
def min_cost(cost):
...