4 ms·
This: $,="\t"; print readlines.map{|r| s=r.split; [s[0].to_i,r]}\ .max{|a,b| a[0]<=>b[0]} It's a ruby one-liner that prints the largest first field an
by atmosx 10y ago
This:
$,="\t"; print readlines.map{|r| s=r.split; [s[0].to_i,r]}\
.max{|a,b| a[0]<=>b[0]}
It's a ruby one-liner that prints the largest first field and the lines that contains that field.
- deleted 10y ago[deleted]