1137. N-th Tribonacci Number

Practice N-th Tribonacci Number for free on NudgeCode: Easy, Dynamic Programming pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.

The Tribonacci sequence starts T0 = 0, T1 = 1, T2 = 1, and every later term is the sum of the three terms before it: T(n) = T(n-1) + T(n-2) + T(n-3). Return T(n).

Example

n = 4   ->  4   (0, 1, 1, 2, 4)
n = 25  ->  1389537

Constraints