FunctionRacerProblemsRace

N-th Tribonacci Number

BeginnerDynamic programmingPython, JavaScript, TypeScript, Java, C++

The sequence T starts with T(0) = 0, T(1) = 1, T(2) = 1, and each later term is the sum of the three terms before it. Return T(n).

Example 1

n 4
returns 4

T(3) = 0+1+1 = 2, T(4) = 1+1+2 = 4.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Dynamic programming problems