Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commit 585ddd3

Browse files
Create Solution.py
1 parent 85103f4 commit 585ddd3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎Fibonacci Number/Solution.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def fib(self, n: int) -> int:
3+
if n == 0:
4+
return 0
5+
elif n == 1:
6+
return 1
7+
else:
8+
return self.fib(n-1) + self.fib(n-2)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /