Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitde3a58e

Browse files
authored
add 746-Min-Cost-Climbing-Stairs
1 parentd093d65 commitde3a58e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
functionminCostClimbingStairs(cost){
2+
cost.push(0);
3+
4+
for(leti=cost.length-3;i>-1;i--){
5+
cost[i]+=Math.min(cost[i+1],cost[i+2]);
6+
}
7+
8+
returnMath.min(cost[0],cost[1]);
9+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp