Skip to content

Instantly share code, notes, and snippets.

@jasonhazel
Last active August 29, 2015 13:56
Show Gist options
  • Save jasonhazel/9191145 to your computer and use it in GitHub Desktop.
Save jasonhazel/9191145 to your computer and use it in GitHub Desktop.
parts = gets.chomp.split.group_by(&:size)
parts.each do |key, part|
puts "#{part.size} words with #{key} letters"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment