I'm having trouble with this section.
Below is my code. And I keep getting the error:
"Oops, try again. It looks like you haven't set the frequencies hash correctly. Check the first exercise if you need help!"
But I got the first exercise OK... I mean obviously since I'm on the 6ht one...
Can someone please explain what I'm doing wrong and WHY it's wrong?
puts "Type something" text = gets.chomp words = text.split(" ") frequencies = Hash.new(0) words.each do |words| puts frequencies [words] frequencies[words] += 1 frequencies[words] = frequencies.sort_by |words, count| count end frequencies.reverse!