I am looking for a proper way to sort by ascending or descending a complex array.
arr = [[100, 200, 300], [100, 250, 600], [50, 10, 1030]]
I would like to sort this array based on the target value [value, value, target_value]
I have my own way to do this but it seems ugly and slow.
Do we have a proper way to do this in ruby?
Thanks in advance.