What's the problem with my code? I can't seem to find it


#1



https://www.codecademy.com/courses/ruby-beginner-en-693PD/0/6?curriculum_id=5059f8619189a5000201fbcb#


Oops, try again. It looks like you haven't set the frequencies hash correctly. Check the first exercise if you need help!


puts "Enter a text"
text = gets.chomp
words = text.split(" ")
puts words

frequencies=Hash.new(0)

words.each do |word|
    frequencies[word]+=1
    frequencies = frequencies.sort_by do |a,b|
        b
end
frequencies.reverse!


#2

I think you forgot to "end" your code


#3

worked!! thanks got it :slight_smile: