Skip to content

Commit 92a3fc2

Browse files
authored
solution on climbing-stairs
1 parent e065a0d commit 92a3fc2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

climbing-stairs/Lustellz.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
11
// 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

Comments
 (0)