I need to sort a list of [x,y]
coordinates that looks like this:
list = [[1,2],[0,2],[2,1],[1,1],[2,2],[2,0],[0,1],[1,0],[0,0]]
The pattern I'm looking for after sorting is:
[x,y]
coordinate shall be sorted by y
first and then by x
. The new list should look like:
list = [[0,0],[1,0],[2,0],[0,1],[1,1],[2,1],[0,2],[1,2],[2,2]]
I can't figure out how to do it and would appreciate some help.