This commit is contained in:
krahets
2024-05-06 05:27:10 +08:00
parent 2395804410
commit 7e7eb6047a
56 changed files with 3908 additions and 42257 deletions

View File

@@ -457,7 +457,7 @@ $$
=== "JS"
```javascript title="min_cost_climbing_stairs_dp.js"
/* 爬楼梯最小代价:状态压缩后的动态规划 */
/* 爬楼梯最小代价:空间优化后的动态规划 */
function minCostClimbingStairsDPComp(cost) {
const n = cost.length - 1;
if (n === 1 || n === 2) {
@@ -477,7 +477,7 @@ $$
=== "TS"
```typescript title="min_cost_climbing_stairs_dp.ts"
/* 爬楼梯最小代价:状态压缩后的动态规划 */
/* 爬楼梯最小代价:空间优化后的动态规划 */
function minCostClimbingStairsDPComp(cost: Array<number>): number {
const n = cost.length - 1;
if (n === 1 || n === 2) {