input = [{:name => "Kutty", :score => 2, :some_key => 'value'},
{:name => "Kutty", :score => 4, :some_key => 'value'},
{:name => "Baba", :score => 5, :some_key => 'value'}]
output = input.group_by { |x| x[:name] }
.map {|x,y|y.max_by {|x|x[:score]}}
puts output
aW5wdXQgPSBbezpuYW1lID0+ICJLdXR0eSIsIDpzY29yZSA9PiAyLCA6c29tZV9rZXkgPT4gJ3ZhbHVlJ30sCiAgICAgICAgIHs6bmFtZSA9PiAiS3V0dHkiLCA6c2NvcmUgPT4gNCwgOnNvbWVfa2V5ID0+ICd2YWx1ZSd9LAogICAgICAgICB7Om5hbWUgPT4gIkJhYmEiLCAgOnNjb3JlID0+IDUsIDpzb21lX2tleSA9PiAndmFsdWUnfV0KCm91dHB1dCA9IGlucHV0Lmdyb3VwX2J5IHsgfHh8IHhbOm5hbWVdIH0KICAgICAgICAgICAgICAubWFwIHt8eCx5fHkubWF4X2J5IHt8eHx4WzpzY29yZV19fQoKcHV0cyBvdXRwdXQ=