How to make a $N{\times}N$ matrix which has its each $i$th row and $i$th column having elements from $0$ to $2N-1$? For Eg:
for $N=4$
$[1,2,3,4]$$
[5,1,4,3]$
$[6,7,1,2]$
$[7,6,5,1]$
Some People have also commented about this being analogous to round robin tournament  and I am not quite getting how to make a matrix for any suitable given N.
This problem was asked in this contest and I don't know the solution yet.
Also this is a problem in International Maths Olympiad.
https://www.codechef.com/JAN20B/problems/DFMTRX
 A: There is no such solution for odd $N \ge 3$. Indeed, each number $a$ must appear in either the $i$-th row or $i$-column implies $a$ must appear in at least $(N+1)/2$ rows or $(N+1)/2$ columns which implies that of the $2N-1$ numbers must appear at least $(N+1)/2$ times, which is imposiible since $(2N-1)(N+1)/2 > N^2$.
To see that there is a solution for all even $N$, first set every element on the diagonal to $2N-1$. Then run a round-robin tournament on $N$ players, where there are $N-1$ rounds, every player plays every round, and every player plays each other player at some point. Suppose $i$ and $j$ play each other on the $k$-th round of the round-robin tournament. Then put the $ij$-th entry to $k$ and the $ji$-th entry to $k+N-1$. The resulting matrix has the desired properties.
A: One first observation is that you can easily "double" a solution in some cases: Suppose for some $N$ you have a solution with the additional assumption that all of the diagonal entries get the same entry $a$. We can produce use this to produce a $2N \times 2N$ matrix with the same property as follows:
For our diagonal label $a$ we pick $2$ new labels $a'$ and $a''$, and then replace each diagonal entry with a $2 \times 2$ matrix \begin{bmatrix}
a & a'\\
a'' & a
\end{bmatrix}
For each non diagonal label $b$ pick a new label $b'$ and replace all instances of $b$ by a $2 \times 2$ matrix \begin{bmatrix}
b & b'\\
b' & b
\end{bmatrix}
It's not hard to check if the original matrix was a solution then so is this new one. Starting with the $1\times 1$ solution iterating this this gives a solution for all powers of $2$.
