Minimum Days for Scheduling All Meetings

Start Timer

0:00:00

Upvote
1
Downvote
Save question
Mark as completed
View comments

You are the office manager responsible for scheduling all meetings in a company. Each meeting has a start time and end time, represented as [[start_1, end_1], [start_2, end_2], …].

Your goal is to find the minimum number of days needed to schedule all meetings without conflicts.

Note: If a meeting ends at the same time another starts, it does not count as a conflict: (2026-12-01 08:00, 2026-12-01 10:00),(2026-12-01 10:00, 2026-12-01 12:00) is not considered a conflict at 10:00.

Example 1

Input:

meetings = [["2026-12-01 09:00", "2026-12-01 17:00"], 
            ["2026-12-01 10:00", "2026-12-01 11:00"], 
            ["2026-12-01 13:00", "2026-12-01 14:00"]]

Output:

def min_days(meetings) -> 2

Explanation:

Day 1: ["2026-12-01 09:00", "2026-12-01 17:00"]
Day 2: ["2026-12-01 10:00", "2026-12-01 11:00"], ["2026-12-01 13:00", "2026-12-01 14:00"]

Since one of the meetings takes the entire working day (from 9 AM to 5 PM), the other needs to be rescheduled to another day; therefore, the answer is 2.

.
.
.
.
.


Comments

Loading comments