Example 1

Example 2

Example 3

n == trees.length1 <= n <= 5 * 104The number of nodes in each tree is in the range [1, 3].Each node in the input may have children but no grandchildren.No two roots of trees have the same value.All the trees in the input are valid BSTs.1 <= TreeNode.val <= 5 * 104.Example 1

Example 2

Example 3

n == trees.length1 <= n <= 5 * 104The number of nodes in each tree is in the range [1, 3].Each node in the input may have children but no grandchildren.No two roots of trees have the same value.All the trees in the input are valid BSTs.1 <= TreeNode.val <= 5 * 104.