Update 0096.不同的二叉搜索树.md

This commit is contained in:
QuinnDK
2021-05-16 11:27:26 +08:00
committed by GitHub
parent 8c3d8aab25
commit 897396c15a

View File

@ -189,7 +189,18 @@ Python
Go Go
```Go
func numTrees(n int)int{
dp:=make([]int,n+1)
dp[0]=1
for i:=1;i<=n;i++{
for j:=1;j<=i;j++{
dp[i]+=dp[j-1]*dp[i-j]
}
}
return dp[n]
}
```