/**
* @param {number} n
* @return {number}
*/
var tribonacci = function (n) {
if (n < 2) return n
let dp = [0, 1, 1]
for (let i = 3; i <= n; i++) {
dp[i] = dp[i - 3] + dp[i - 2] + dp[i - 1]
}
return dp[n]
};
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)