Skip to content
← Back to the archive

9 September 2026

Popular Study Rooms

Medium Dictionaries Lists

Find the study rooms that were booked at least a minimum number of times.

A study space tracks its room bookings for the day. You are given a list of bookings, each naming the hour it was booked and the room, in the order the bookings were made. You are also given a minimum number of bookings. Count how many times each room was booked. Return the names of every room whose booking count is at least the minimum, listed in the order each room was first booked. If no room reaches the minimum, return an empty list.

Constraints

  • bookings has between 0 and 500 entries
  • each room name has between 1 and 30 characters
  • hour is a whole number between 0 and 23
  • minimum_bookings is a whole number between 1 and 500

Function signature

def frequently_booked_rooms(bookings, minimum_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+.