add new solutions

This commit is contained in:
kanna5 2026-01-05 16:48:03 +09:00
parent 9a10695e8c
commit ca24d0a56a
Signed by: kkyy
GPG key ID: 06332F3965E9B0CF
30 changed files with 697 additions and 16 deletions

View file

@ -0,0 +1,11 @@
package q746
func minCostClimbingStairs(cost []int) int {
minCost := make([]int, len(cost)+1)
for i := 2; i < len(minCost); i++ {
minCost[i] = min(minCost[i-2]+cost[i-2], minCost[i-1]+cost[i-1])
}
return minCost[len(minCost)-1]
}
var _ = minCostClimbingStairs