Min Cost Climbing Stairs
Easy · Dynamic Programming · about 10 minutes
Asked at Meta, Google, Amazon, Microsoft.
Landing on stair i costs cost[i]. From a stair you can move up one or two stairs, and you may begin on either stair 0 or stair 1. The goal is to get beyond the final stair. What is the cheapest way to do it?