Fibonacci Number

The Fibonacci numbers form a sequence where each number is the sum of the two preceding ones, starting from 0 and 1.

Constraints

  • 0 <= n <= 30
Saving… · 2 lines
class Solution:
def fibonacciNumber(self, n: int) -> int:
Console

Click Run to execute sample tests.