Whats wrong with solution?


#1

Hello all, I am trying this tutorial for more than hour long but didn't able to get accepted my solution. Can someone please tell me what's wrong with my solution

fruits = ["orange", "apple", "banana", "pear", "grapes"]
fruits.sort.reverse! #first of all this will return the sorted array in descending order but this is not acceptable by judge.

fruits = ["orange", "apple", "banana", "pear", "grapes"]
fruits.sort! {|left, right| left <=>right}

Then i tried with this solution. This one is also not acceptable


#2

I was doing a small mistake, acceptable solutions are follows

fruits = ["orange", "apple", "banana", "pear", "grapes"]
fruits.sort! {|left,right| right <=> left}

And

fruits = ["orange", "apple", "banana", "pear", "grapes"]
fruits.sort! {|left, right| left <=> right}
fruits.reverse!