if I have a collection of hashes with the same key and values, how do I add another value together : Say I've assigned the rows below to hashes. How do I add together the :amount values for a specific id number? (so for id: 1, I need the total= 9290+2262)

other_id: 1,amount: 9290,id: 1
other_id: 2,amount: 2262,id: 1
other_id: 3,amount: 9588,id: 2
other_id: 4,amount: 1634,id: 2

or even better, if I had a large collection of these. how would I write code so that it would find the id number with the maximum value of total (if total is the sum of all amount instances for a specific id number)