Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # require 'pry'
- def character_counting(characters)
- result = Hash.new(0)
- characters.delete(' ').chars.map do |change_to_one_big_array|
- # binding.pry
- change_to_one_big_array.split("").map {|count_the_letters| result[count_the_letters] += 1}
- end
- result
- end
- puts character_counting("lighthouse in the house...")
- #chars is the best
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement