Skip to content

Practice Min Cost Climbing Stairs

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#746
LeetCode Problem

Min Cost Climbing Stairs

Problem Statement

Step i costs cost[i]. After paying for a step, move forward either one or two steps. You may begin at step 0 or step 1. Return the minimum total cost to reach the position just beyond the final step, at index cost.length.

Source: Min Cost Climbing Stairs on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
cost = [10,15,20]
Output
15

# Example 2

Input
cost = [1,100,1,1,1,100,1,1,100,1]
Output
6

Constraints

2 <= cost.length <= 1000
0 <= cost[i] <= 999

Related LeetCode Problems

Practice more problems similar to Min Cost Climbing Stairs.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.