<p>You are given three positive integers: <code>n</code>, <code>index</code>, and <code>maxSum</code>. You want to construct an array <code>nums</code> (<strong>0-indexed</strong>)<strong></strong>that satisfies the following conditions:</p>
<ul>
<li><code>nums.length == n</code></li>
<li><code>nums[i]</code> is a <strong>positive</strong> integer where <code>0 <= i < n</code>.</li>
<li><code>abs(nums[i] - nums[i+1]) <= 1</code> where <code>0 <= i < n-1</code>.</li>
<li>The sum of all the elements of <code>nums</code> does not exceed <code>maxSum</code>.</li>
<li><code>nums[index]</code> is <strong>maximized</strong>.</li>
</ul>
<p>Return <code>nums[index]</code><em> of the constructed array</em>.</p>
<p>Note that <code>abs(x)</code> equals <code>x</code> if <code>x >= 0</code>, and <code>-x</code> otherwise.</p>