Your question is Count Unique Binary Search Trees. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an integer n, return the number of structurally unique binary search trees that can be formed using the distinct values 1 through n. Two trees are considered different if their structure differs, even if they contain the same set of values. The function should return a single integer.
def num_trees(n):