<p>You are given <code>n</code><strong>BST (binary search tree) root nodes</strong> for <code>n</code> separate BSTs stored in an array <code>trees</code> (<strong>0-indexed</strong>). Each BST in <code>trees</code> has <strong>at most 3 nodes</strong>, and no two roots have the same value. In one operation, you can:</p>
<ul>
<li>Select two <strong>distinct</strong> indices <code>i</code> and <code>j</code> such that the value stored at one of the <strong>leaves </strong>of <code>trees[i]</code> is equal to the <strong>root value</strong> of <code>trees[j]</code>.</li>
<li>Replace the leaf node in <code>trees[i]</code> with <code>trees[j]</code>.</li>
<li>Remove <code>trees[j]</code> from <code>trees</code>.</li>
</ul>
<p>Return<em> the <strong>root</strong> of the resulting BST if it is possible to form a valid BST after performing </em><code>n - 1</code><em> operations, or</em><em></em><code>null</code><i>if it is impossible to create a valid BST</i>.</p>
<p>A BST (binary search tree) is a binary tree where each node satisfies the following property:</p>
<ul>
<li>Every node in the node's left subtree has a value <strong>strictly less</strong> than the node's value.</li>
<li>Every node in the node's right subtree has a value <strong>strictly greater</strong> than the node's value.</li>