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 6eacab8 commit d533203Copy full SHA for d533203
solutions/0509-Fibonacci-Number/0509.py
@@ -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