Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created May 6, 2016 22:28
Show Gist options
  • Save chuck0523/119ad15321cd485f62dcbe768c36d810 to your computer and use it in GitHub Desktop.
Save chuck0523/119ad15321cd485f62dcbe768c36d810 to your computer and use it in GitHub Desktop.
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