Created
June 8, 2018 10:47
-
-
Save sunloverz/4b8a4c3852e62c07a365fdbcafa2422f 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 = '123456789012345678909999991234569999' | |
h = {} | |
str.split("").each do |i| | |
h[i] = 0 if h[i].nil? | |
h[i] += 1 | |
end | |
h.each do |key, value| | |
puts "#{key} #{"*"*value}" | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment