You are given a positive integer k and two conditions:
A 2D integer array row_conditions of size n, where row_conditions[i] = [above[i], below[i]]. This indicates that above[i] must appear in a row above below[i] in the final matrix.
A 2D integer array col_conditions of size m, where col_conditions[i] = [left[i], right[i]]. This indicates that left[i] must appear in a column to the left of right[i] in the final matrix.
Both arrays contain integers ranging from 1 to k.
You need to construct a k×k matrix that includes all the integers from 1 to ...