N-th Tribonacci Number
Try to solve the N-th Tribonacci Number problem.
We'll cover the following
Statement
Given a number n
, calculate the corresponding Tribonacci number.
The Tribonacci sequence is defined as:
, and for |
---|
The input number, n
, is a non-negative integer.
Constraints:
-
n
- The answer is guaranteed to fit within a 32-bit integer, i.e., answer
Examples
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy