We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fc517a commit d238880Copy full SHA for d238880
climbing-stairs/highball.js
@@ -0,0 +1,11 @@
1
+const climbStairs = function (n) {
2
+ const dp = [1, 1];
3
+
4
+ for (let i = 0; i < n - 1; i++) {
5
+ const temp = dp[1];
6
+ dp[1] = temp + dp[0];
7
+ dp[0] = temp;
8
+ }
9
10
+ return dp[1];
11
+};
0 commit comments