Ad
  • Custom User Avatar

    hash.revert will not sort name.

    {"kay"=>77, "john"=>14, "alice"=>77}.invert #=> {77=>"alice", 14=>"john"} the anwer is alice

    {"alice"=>77, "john"=>14, "kay"=>77}.invert #=> {77=>"kay", 14=>"john"} the answer is kay

    So I think your solution does not yet solve the problem. am I right?