Easy · Math

Fibonacci number

Given an integer n with 0 ≤ n ≤ 92, return the Fibonacci number F(n), where F(0) = 0, F(1) = 1 and F(n) = F(n−1) + F(n−2).

Examples

Example 1

n = 7

Output: F(7) = 13

Example 2

n = 0

Output: F(0) = 0

Rebuild it in the studio

Open every published interview problem, solution, scene, and memory room free, with no account.

More Math problems