17 September 2026 · Advanced track
Most Focused Crew
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 recordsEach crew name contains from 1 to 30 lowercase ASCII lettersminutes is an integer from 1 to 10,000A crew’s session span is its final session position minus its first session position
Function signature
def most_focused_crew(sessions):