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 e065a0d commit 92a3fc2Copy full SHA for 92a3fc2
climbing-stairs/Lustellz.ts
@@ -1 +1,9 @@
1
// week2 goal
2
+// not knowing how to express, I googled and referenced a bit
3
+function climbStairs(n: number): number {
4
+ let stairArray: number[] = [1,2]
5
+ for(let i = 2;i<n; i++){
6
+ stairArray.push(stairArray[i-1]+stairArray[i-2])
7
+ }
8
+ return stairArray[n-1]
9
+};
0 commit comments