Skip to content
← Back to the archive

18 September 2026

Top Food Drive Supply

Hard Dictionaries Records

Find the supply type with the largest total number of items delivered to a food drive.

A community food drive receives deliveries throughout the day. Each delivery record contains a supply name and the number of items in that delivery. Add the delivered items for each supply name. Return the supply name with the largest total number of items delivered. If two supply names have the same largest total, return the one that comes first alphabetically.

Constraints

  • deliveries contains from 1 to 1,000 delivery records
  • Each supply name contains from 1 to 30 lowercase ASCII letters
  • units is an integer from 1 to 10,000

Function signature

def top_supply(deliveries):

Sign in to solve this bracket

Reading the problem is free for everyone. Opening the editor and solving it requires an account with Open Bracket+.