Unique Binary Search Trees Solutions in GoNumber 96Difficulty MediumAcceptance 53.0%Link LeetCodeOther languages C++, PythonSolutionsGo solution by halfrost/LeetCode-Gopackage leetcode func numTrees(n int) int { dp := make([]int, n+1) dp[0], dp[1] = 1, 1 for i := 2; i <= n; i++ { for j := 1; j <= i; j++ { dp[i] += dp[j-1] * dp[i-j] } } return dp[n]}package leetcode func numTrees(n int) int { dp := make([]int, n+1) dp[0], dp[1] = 1, 1 for i := 2; i <= n; i++ { for j := 1; j <= i; j++ { dp[i] += dp[j-1] * dp[i-j] } } return dp[n] }