refactored anagram.rb: count_letters uses .tap method