Uhhh I don't see how this relates to videogames, but okay....
You have to start up with them in an ascending/descending order, and vertically add the others by shifting values.
The two solutions would be:
[1 2 3 4 5] [5 4 3 2 1]
[5 1 2 3 4] [1 5 4 3 2]
[4 5 1 2 3] [2 1 5 4 3]
[3 4 5 1 2] [3 2 1 5 4]
[2 3 4 5 1] [4 3 2 1 5]
Obviously this will work only for completely empty sets. If some numbers are already filled in, you need to find the solution on your own by logic...