I have an array of points:
arr = [[2,0], [1,0], [2,1], [1,1]]
How would I sort the elements in descending and ascending orders by x first and then by y values of the similar x value?
max = [[2,1], [2,0], [1,1], [1,0]]
min = [[1,0], [1,1], [2,0], [2,1]]
.