配列の最小値、最大値を求める
Top > Ruby [2.2.2] > min , max , minmax , min_by , max_by, minmax_by
ary = [32 , 89 , 3 , 45 , 104] p ary.min # 3 p ary.max # 104 p ary.minmax # [3, 104] p ary.min_by{ |v| v % 10 } # 32 p ary.max_by{ |v| v % 10 } # 89 p ary.minmax_by{ |v| v % 10 } # [32, 89] p ary.min_by{ |v| v % 5 } # 45 p ary.max_by{ |v| v % 5 } # 89 p ary.minmax_by{ |v| v % 5 } # [45, 89]