Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f0a2e2b

Browse filesBrowse files
Update 070.py
1 parent 0b7eb29 commit f0a2e2b
Copy full SHA for f0a2e2b

File tree

1 file changed

+8
-0
lines changed
Filter options

1 file changed

+8
-0
lines changed

‎001-500/070.py

Copy file name to clipboardExpand all lines: 001-500/070.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@ def climbStairs(self, n: int) -> int:
44
for i in range(2,n+2):
55
fib.append(fib[i-1]+fib[i-2])
66
return fib[n+1]
7+
8+
class Solution:
9+
def climbStairs(self, n: int) -> int:
10+
a,b=1,1
11+
while n>0:
12+
a,b = b,a+b
13+
n-=1
14+
return a

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.