Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ysayaovong/min-cost-climbing-stairs
- Owner: YSayaovong
- Created: 2024-08-21T17:44:34.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-21T17:48:32.000Z (4 months ago)
- Last Synced: 2024-08-21T20:02:24.359Z (4 months ago)
- Language: TypeScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.