Min Cost Climbing Stairs

Given the cost of each step, find the minimum cost to reach the top.

Input Format

Integer n
n space-separated integers (cost of each step)

Output Format

Minimum total cost

Sample Input

4
10 15 20 5

Sample Output

15

Try Your Code

← Back to Problems List