Skip to content

Commit d533203

Browse files
committed
💚Upload 0509 Code
💚Upload 0509 Code
1 parent 6eacab8 commit d533203

File tree

1 file changed

+6
-0
lines changed
  • solutions/0509-Fibonacci-Number

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution:
2+
def fib(self, n: int) -> int:
3+
dp_0, dp_1 = 0, 1
4+
for _ in range(n):
5+
dp_0, dp_1 = dp_1, dp_0 + dp_1
6+
return dp_0 % 1000000007

0 commit comments

Comments
 (0)