<p>You are given a <strong>0-indexed</strong> integer array <code>nums</code> whose length is a power of <code>2</code>.</p>
<p>Apply the following algorithm on <code>nums</code>:</p>
<ol>
<li>Let <code>n</code> be the length of <code>nums</code>. If <code>n == 1</code>, <strong>end</strong> the process. Otherwise, <strong>create</strong> a new <strong>0-indexed</strong> integer array <code>newNums</code> of length <code>n / 2</code>.</li>
<li>For every <strong>even</strong> index <code>i</code> where <code>0 <= i < n / 2</code>, <strong>assign</strong> the value of <code>newNums[i]</code> as <code>min(nums[2 * i], nums[2 * i + 1])</code>.</li>
<li>For every <strong>odd</strong> index <code>i</code> where <code>0 <= i < n / 2</code>, <strong>assign</strong> the value of <code>newNums[i]</code> as <code>max(nums[2 * i], nums[2 * i + 1])</code>.</li>
<li><strong>Replace</strong> the array <code>nums</code> with <code>newNums</code>.</li>
<li><strong>Repeat</strong> the entire process starting from step 1.</li>
</ol>
<p>Return <em>the last number that remains in </em><code>nums</code><em> after applying the algorithm.</em></p>