I want to sort the following list of list
[[2, -10], [9, 10], [3, -15], [7, 15], [5, -12], [12, 12], [15, -10], [20, 10], [19, -8], [24, 8]]
I want to sort based on the first element of the list. If the first element is the same, then sort based on the second element in the list
How would I do this in Python 3
In Java, it looks like this
Collections.sort(heights, (a, b) -> (a[0] == b[0] ? a[1] - b[1] : a[0] - b[0]));