For this Question: Fibonacci numbers are interesting but Tribonacci numbers are more interesting.
A Tribonacci number T(n) is the sum of the preceding three elements in a series. Consider its first three numbers to be 0, 0, and 1. i. e T(1) = 0, T(2) = 0, T(3) = 1. 
Given a number N, your task is to return the nth Tribonacci number.The input contains a single integer N.

Constraints:-
1 <= N <= 20Return the Nth Tribonacci number.Sample Input:-
4

Sample Output:-
1

Sample Input:-
7

Sample Output:-
7, I have written this Solution Code: class Solution:
    def tribonacci(self, n: int) -> int:
        if n == 0:
            return 0
        elif n == 1 or n == 2:
            return 1
        
        dp = []
        for i in range(n+1):
            dp.append(-1)
        dp[0] =dp[1] = 0
        dp[2] = 1
        
        for i in range(3, n+1):
            dp[i] = dp[i-1] + dp[i-2] + dp[i-3]
            
        return dp[n-1]
        
    n=int(input())
    num=tribonacci(n,n)
    print(num), In this Programming Language: Python, Now tell me if this Code is compilable or not?