Ctrl K
Problem

Cheapest Climb to the Top

Easy · Cheapest Climb to the Top

A staircase has steps `0, 1, …, n - 1`, and standing on step `i` costs `fees[i]`. The top lies just past the last step and is free. From the floor you may step straight onto step `0` or step `1`. After paying for a step, you move up either one step or two. Return the smallest total you have to pay to reach the top.…

Solve the problem →