<p>You are given a <strong>positive</strong> integer <code>k</code>. You are also given:</p>
<ul>
<li>a 2D integer array <code>rowConditions</code> of size <code>n</code> where <code>rowConditions[i] = [above<sub>i</sub>, below<sub>i</sub>]</code>, and</li>
<li>a 2D integer array <code>colConditions</code> of size <code>m</code> where <code>colConditions[i] = [left<sub>i</sub>, right<sub>i</sub>]</code>.</li>
</ul>
<p>The two arrays contain integers from <code>1</code> to <code>k</code>.</p>
<p>You have to build a <code>k x k</code> matrix that contains each of the numbers from <code>1</code> to <code>k</code><strong>exactly once</strong>. The remaining cells should have the value <code>0</code>.</p>
<p>The matrix should also satisfy the following conditions:</p>
<ul>
<li>The number <code>above<sub>i</sub></code> should appear in a <strong>row</strong> that is strictly <strong>above</strong> the row at which the number <code>below<sub>i</sub></code> appears for all <code>i</code> from <code>0</code> to <code>n - 1</code>.</li>
<li>The number <code>left<sub>i</sub></code> should appear in a <strong>column</strong> that is strictly <strong>left</strong> of the column at which the number <code>right<sub>i</sub></code> appears for all <code>i</code> from <code>0</code> to <code>m - 1</code>.</li>
</ul>
<p>Return <em><strong>any</strong> matrix that satisfies the conditions</em>. If no answer exists, return an empty matrix.</p>