497. N-th Tribonacci Number
EasyDP
T0 = 0, T1 = 1, T2 = 1 and Tn = Tn−1 + Tn−2 + Tn−3. Print Tn.
Input format
One integer n
Output format
Tn
Example 1
Input
4
Output
4
Example 2
Input
25
Output
1389537
Constraints
0 ≤ n ≤ 37
Read input from standard input and print the answer to standard output. Your code is judged against 4 test cases, most of them hidden.
Loading the MyLoginn IDE…