----- my code -----

puts " Input a Number: "

text = gets.chomp

words = text.split (" ")

frequencies = Hash.new (0)

words.each { |x| frequencies[x] += 1 }

frequencies = frequencies.sort_by { | 0 , 100 | 100}

frequencies.reverse!

can somebody explain me this stuff im stuck here

---- INSTRUCTIONS -----

Use .sort_by to sort the frequencies hash by word count, like step 2 above. Store the result back in frequencies.

Use .reverse! to reverse the sorted frequencies array.

Check the Hint for more details!

Our first step should be to reassign frequencies to its sorted version (.sort_by doesn't sort the hash in-placeāit will create a copy that is sorted):

frequencies = frequencies.sort_by { |k, v| v }

This actually returns an array of values, which you can then reverse in-place with reverse!:

frequencies.reverse!

---- THATS THE HINT ------

----- THIS IS THE ERROR ----

(ruby):9: syntax error, unexpected tINTEGER, expecting '|'

frequencies = frequencies.sort_by { | 0 , 100 | 100}

^