Sha256: 937386d9a3501f55ee8ee0b56effc55694c1c3a383f1571023f26050b69e761e
Contents?: true
Size: 214 Bytes
Versions: 6
Compression:
Stored size: 214 Bytes
Contents
class Array def histogram histogram = each_with_object(Hash.new(0)) {|n, memo| memo[n] += 1}.sort_by{|k, v| -v} return Hash[histogram] end def by_popularity return histogram.keys end end
Version data entries
6 entries across 6 versions & 1 rubygems