# Leetcode 95 - Unique BST II

`Note:`

- Three question to ask yourself before writing a recursion function:
- What’s the base case?
- What am I gonna return?
- WHat should I do with returned calls in each recursion?

- Base case:
- Because we use
`low, right`

to find node vals. The base should be there is no options left, so`low > right`

and we return null.

- Because we use
- Return type?
- Since the question requires an array, we should return an array.

- What to do with returned calls?
- For a
`root`

, we found its`leftSubtrees`

and`rightSubtrees`

. We should combine them up with our`root`

and push them into the return array.

- For a

`Question:`

Given an integer `n`

, return all the structurally unique `BST`

‘s (binary search trees), which has exactly n nodes of unique values from `1`

to `n`

. Return the answer in any order.

`Example:`

1 | Input: n = 3 |

`Code:`

1 | /** |