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 entrieseach room name has between 1 and 30 charactershour is a whole number between 0 and 23minimum_bookings is a whole number between 1 and 500
Function signature
def frequently_booked_rooms(bookings, minimum_bookings):