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 61b0e11 commit fbbbae1Copy full SHA for fbbbae1
1 file changed
climbing-stairs/mrlee7.py
@@ -0,0 +1,8 @@
1
+class Solution:
2
+ def climbStairs(self, n: int) -> int:
3
+ stairs = {1: 1, 2:2}
4
+
5
+ for i in range(3, n + 1):
6
+ stairs[i] = stairs[i - 1] + stairs[i - 2]
7
8
+ return stairs[n]
0 commit comments