Tap here to switch tabs
Problem
Submissions

Problem: Fibonacci Number

Fibonacci Number asks you to compute the term at a given nonnegative position in the Fibonacci sequence, where each term after the first two is the sum of its predecessors.

Statement

The Fibonacci sequence is a famous series of numbers in which each value is created by adding the two preceding numbers. The sequence begins with:

  • F(0)=0F(0) = 0

  • F(1)=1F(1) = 1

From that point on, every term is defined as:

  • F(n)=F(n−1)+F(n−2)F(n) = F(n - 1) + F(n - 2), for any nn greater than 11

Your task is to compute the value of F(n)F(n) for a given integer n.

Constraints:

  • 0≤0 \leq n ≤30\leq 30

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Fibonacci Number

Fibonacci Number asks you to compute the term at a given nonnegative position in the Fibonacci sequence, where each term after the first two is the sum of its predecessors.

Statement

The Fibonacci sequence is a famous series of numbers in which each value is created by adding the two preceding numbers. The sequence begins with:

  • F(0)=0F(0) = 0

  • F(1)=1F(1) = 1

From that point on, every term is defined as:

  • F(n)=F(n−1)+F(n−2)F(n) = F(n - 1) + F(n - 2), for any nn greater than 11

Your task is to compute the value of F(n)F(n) for a given integer n.

Constraints:

  • 0≤0 \leq n ≤30\leq 30