I am surprised that default solution is working.
frequencies.each do |word, frequency|
puts word + " " + frequency
Frequencies is array of arrays, something like this:
frequencies = [["Sally", 3], ["Harry", 2], ["met", 1]]
I would expect that each will give you an array, not 2 values. I would expect that you need to write it like this:
frequencies.each do |frequency|
puts frequency + " " + frequency
What's going on behind the scenes to make first example work?