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

Core interview problems are free with a full runner and lessons; Pro opens the complete library.

More Math problems