<p>A <strong>maximum tree</strong> is a tree where every node has a value greater than any other value in its subtree.</p>
<p>You are given the <code>root</code> of a maximum binary tree and an integer <code>val</code>.</p>
<p>Just as in the <ahref="https://leetcode.com/problems/maximum-binary-tree/"target="_blank">previous problem</a>, the given tree was constructed from a list <code>a</code> (<code>root = Construct(a)</code>) recursively with the following <code>Construct(a)</code> routine:</p>
<ul>
<li>If <code>a</code> is empty, return <code>null</code>.</li>
<li>Otherwise, let <code>a[i]</code> be the largest element of <code>a</code>. Create a <code>root</code> node with the value <code>a[i]</code>.</li>
<li>The left child of <code>root</code> will be <code>Construct([a[0], a[1], ..., a[i - 1]])</code>.</li>
<li>The right child of <code>root</code> will be <code>Construct([a[i + 1], a[i + 2], ..., a[a.length - 1]])</code>.</li>
<li>Return <code>root</code>.</li>
</ul>
<p>Note that we were not given <code>a</code> directly, only a root node <code>root = Construct(a)</code>.</p>
<p>Suppose <code>b</code> is a copy of <code>a</code> with the value <code>val</code> appended to it. It is guaranteed that <code>b</code> has unique values.</p>