We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
group_by for counters — Using group_by + map to count elements allocates many arrays. Use Hash with default value or tally.
group_by
map
Hash
tally
ary.group_by { |x| x }.map { |k, v| [k, v.size] }
There was an error while loading. Please reload this page.