Skip to content
← Back to the archive

17 September 2026 · Advanced track

Most Focused Crew

Advanced Dictionaries Records

Find the crew with the most logged work minutes, preferring the crew whose sessions are closest together.

An events coordinator records completed work sessions in the order they finish. Each session names a crew and its number of work minutes. Add the work minutes for each crew. Return the crew with the largest total number of work minutes. If crews tie for the largest total: - Return the crew whose first and final sessions are closest together in the session list. - If those spans are also tied, return the crew name that comes first alphabetically.

Constraints

  • sessions contains from 1 to 1,000 records
  • Each crew name contains from 1 to 30 lowercase ASCII letters
  • minutes is an integer from 1 to 10,000
  • A crew’s session span is its final session position minus its first session position

Function signature

def most_focused_crew(sessions):

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