2 ms·tasks.sort { |a,b| b.difficulty <=> a.difficulty }by conanbatt 9y agotasks.sort { |a,b| b.difficulty <=> a.difficulty }majewsky 9y agotasks.sort_by(&:difficulty).reverse Readable code FTW.conanbatt 9y agoO(n logn + n)??? do you think computing power grows on trees?majewsky 9y agoThen use Perl. Perl has this weird feature where "reverse(sort(...))" gets optimized into a single op.