Sep-25-2020, 02:45 PM
You could create a list of lists filled with zeroes, of size n x n. Then you could start at a position
i, j = 0, 0
and for each number in 1,...,n**2, you would store this number at the current position, then move to the next position.