Minimum Cost Climbing Stairs

easy
Checkpoint challenge
Solve this to show you know the material and jump straight to Unit 3. Everything before it counts as cleared.

Each step i has a cost cost[i] you pay when you step on it. You can start on step 0 or 1 and climb 1 or 2 steps at a time; the top is just past the last step. Return the minimum total cost to reach the top, in O(n) time and O(1) space.

Also implement ways(n, steps): the number of distinct ways to climb exactly n stairs when each move can be any size in the list steps.

#dynamic-programming2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Minimum Cost Climbing Stairs · TechGradify