题目
Given n, how many structurally unique BST’s (binary search trees) that store values 1 … n?
Example:
1 | Input: 3 |
思路
DP.
代码
1 | class Solution(object): |
Given n, how many structurally unique BST’s (binary search trees) that store values 1 … n?
Example:
1 | Input: 3 |
DP.
1 | class Solution(object): |