Sum shillings by city.
Goal
Puts 25 units, 1000 shillings, and Nairobi as busiest.
rows = [
{ city: "Nairobi", units: 12, shillings: 480 },
{ city: "Mombasa", units: 8, shillings: 320 },
{ city: "Kisumu", units: 5, shillings: 200 },
]
units = rows.reduce(0) { |a, r| a + r[:units] }
shillings = rows.reduce(0) { |a, r| a + r[:shillings] }
busiest = rows.max_by { |r| r[:units] }
puts "units #{units}"
puts "shillings #{shillings}"
puts "busiest #{busiest[:city]}"