Last active
November 12, 2020 14:36
-
-
Save alexwebgr/3f316b54ebd3537e0e1282615dbc2b71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str = "aabbbaa" | |
count = Hash.new(0) | |
str.each_char { |c| count[c] += 1 } | |
puts count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment