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