Skip to content

3440. Reschedule Meetings for Maximum Free Time II #1910

Answered by mah-shamim
mah-shamim asked this question in Q&A
Discussion options

You must be logged in to vote

We need to maximize the longest continuous period of free time during an event by rescheduling at most one meeting. The meetings are initially non-overlapping, and we can move one meeting to any available gap that can accommodate its duration without overlapping with other meetings. The goal is to find the maximum free time achievable after such a rescheduling.

Approach

  1. Initial Setup: Calculate the initial gaps between meetings, including the gaps before the first meeting, between consecutive meetings, and after the last meeting.
  2. Original Maximum Gap: Compute the maximum gap from the initial gaps. This serves as the baseline if no meetings are moved.
  3. Evaluate Each Meeting: For each meeti…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kovatz
Comment options

kovatz Jul 10, 2025
Collaborator

@mah-shamim
Comment options

mah-shamim Jul 10, 2025
Maintainer Author

Answer selected by kovatz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested medium Difficulty
2 participants