Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
nums = [1, 2, 1, 4, 5, 5, 2, 3]
puts nums.max_by {|x| nums.count(x)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment