Nth Tribonacci Number Leetcode Javascript Solution