Skip to content

Instantly share code, notes, and snippets.

@IrakliJani
Created May 11, 2014 08:12
Show Gist options
  • Save IrakliJani/d7c53afe2dc727210655 to your computer and use it in GitHub Desktop.
Save IrakliJani/d7c53afe2dc727210655 to your computer and use it in GitHub Desktop.
Kata solution for Ruby user group georgia
def count str
str.split('').reduce(Hash.new 0) { |memo, c| memo[c] += 1; memo }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment