Frequencies hash not set correctly.... really?


#1

Hi guys

I’m stuck at the Iterating Over Array lesson. Any ideas? Thanks

Error Message:
It looks like you haven’t set the frequencies hash correctly. Check the Hint if you need help!

puts "Text please"
text = gets.chomp
words = text.split(" ")

frequencies=Hash.new(0)
words.each do
  frequencies[words] +=1
end

Replace this line with your code.

<do not remove the three backticks above>

#2

Please post a link to this exercise. Thanks.

Missing the block parameter.

words.each do |word|
    frequencies[word] ...
end

#4

Thank you ! It worked


#5