val memoization = MutableList<Int>(40){-1}
class Solution {
fun tribonacci(n: Int): Int {
if(n==0) return 0
if(n==1) return 1
if(n==2) return 1
if(memoization[n] == -1)
memoization[n] = tribonacci(n-3) + tribonacci(n-2) + tribonacci(n-1)
return memoization[n]
}
}