Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ysayaovong/min-cost-climbing-stairs

You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps. You can either start from the step with index 0, or the step with index 1. Return the minimum cost to reach the top of the floor.
https://github.com/ysayaovong/min-cost-climbing-stairs

Last synced: about 1 month ago
JSON representation

You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you can either climb one or two steps. You can either start from the step with index 0, or the step with index 1. Return the minimum cost to reach the top of the floor.

Awesome Lists containing this project

README

        

# Min-Cost Climbing Stairs

This TypeScript program solves the "Min-Cost Climbing Stairs" problem. You are given an array where each element represents the cost of stepping on a stair. You can either climb one or two steps at a time, starting from index 0 or 1. The goal is to calculate the minimum cost to reach the top of the floor.

### Features:
- Dynamic programming approach.
- Handles varying stair costs.