Mega Code Archive

 
Categories / Ruby / Range
 

Minmax_by with block

(1..100).minmax_by {|n| n.to_s }  # => [1,99]  min, max as strings