Skip to content
← Back to the archive

20 September 2026

Quietest Trailhead

Hard Dictionaries Records

Find the trailhead with the smallest total number of recorded hikers.

A national park records how many hikers enter at each trailhead during the day. Each visit record contains a trailhead name and a number of hikers. Add the hiker counts for each trailhead. Return the trailhead with the smallest total number of hikers. If two trailheads have the same smallest total, return the name that comes first alphabetically.

Constraints

  • visits contains from 1 to 1,000 visit records
  • Each trailhead name contains from 1 to 30 lowercase ASCII letters
  • hikers is an integer from 0 to 10,000

Function signature

def quietest_trailhead(visits):

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+.