I have a groovy list of lists i.e.
list = [[2, 0, 1], [1, 5, 2], [1, 0, 3]]
I would like sort it by order of the first element, then second, th
Done the Groovy way, regardless of the size of sub-lists:
ll2.sort { l1, l2 -> e1e2 = [l1, l2].transpose().find { e1, e2 -> e1 != e2 } e1e2 ? e1e2[0] <=> e1e2[1] : 0 }