 All Problems
Unique Binary Search Trees
medium
dynamic programming
trees
math
amazon
google
microsoft

Given an integer n, return the number of structurally unique BSTs that store values 1 through n. This is the n-th Catalan number.

Example 1:

Input: 3
Output: 5

Example 2:

Input: 1
Output: 1

Input format: Single integer n.

Output format: Number of unique BSTs.

Run to check your code against the sample cases, or submit to run every case