Skip to content

Commit b67945a

Browse files
authored
Create 70-Climbing-Stairs.py
1 parent b212774 commit b67945a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

70-Climbing-Stairs.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def climbStairs(self, n: int) -> int:
3+
if n <= 3: return n
4+
n1, n2 = 2, 3
5+
6+
for i in range(4, n + 1):
7+
temp = n1 + n2
8+
n1 = n2
9+
n2 = temp
10+
return n2

0 commit comments

Comments
 (0)