Algorithm · Snowflake · Easy
Fibonacci Number Easy · Topics · Company Tags · Hints Write a function that computes the $$n$$-th term of the Fibonacci sequence. The sequence is initialized with: $$F(0) = 0, \quad F(1) = 1$$ For every integer $$n \ge 2$$, each term is the sum of the two preceding terms: $$F(n) = F(n-1) + F(n-2)$$ The function receives an integer n and should return $$F(n)$$. Example 1: Explanation: The first eight Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, so the term at index 7 is 13.…
Checking your access…