N-th Tribonacci Number Solutions in GoNumber 1137Difficulty EasyAcceptance 55.9%Link LeetCodeOther languages C++SolutionsGo solution by halfrost/LeetCode-Gopackage leetcode func tribonacci(n int) int { if n < 2 { return n } trib, prev, prev2 := 1, 1, 0 for n > 2 { trib, prev, prev2 = trib+prev+prev2, trib, prev n-- } return trib}package leetcode func tribonacci(n int) int { if n < 2 { return n } trib, prev, prev2 := 1, 1, 0 for n > 2 { trib, prev, prev2 = trib+prev+prev2, trib, prev n-- } return trib }