Skip to content
← Back to the archive

15 September 2026 · Advanced track

Busiest Rehearsal Room

Advanced Dictionaries Records

Find the rehearsal room with the most booked minutes, using its final booking position to break a tie.

A community theatre records room bookings in the order they are received. Each booking contains a room name and its number of booked minutes. Add the booked minutes for each room. Return the room with the largest total number of booked minutes. If rooms tie for the largest total, return the room whose final booking appears earlier in the booking list.

Constraints

  • bookings contains from 1 to 1,000 records
  • Each room name contains from 1 to 30 lowercase ASCII letters
  • minutes is an integer from 1 to 10,000

Function signature

def busiest_room(bookings):

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