Reschedule Meetings for Maximum Free Time I - Problem
Meeting Scheduler Challenge: You're managing a busy schedule during an event that runs from t = 0 to t = eventTime. You have n non-overlapping meetings already scheduled, where the i-th meeting runs from startTime[i] to endTime[i].

Here's the twist: you can reschedule at most k meetings by moving their start times (while keeping the same duration) to create the longest possible continuous block of free time. However, there are important constraints:

Relative order must be preserved - you can't swap meetings around
Meetings must remain non-overlapping
All meetings must stay within the event timeframe

Your goal is to find the maximum amount of continuous free time you can create by strategically rescheduling up to k meetings. Think of it as Tetris for your calendar - how can you rearrange the pieces to create the biggest gap?

Input & Output

Constraints

Asked in
25.0K Views
Medium Frequency
~15 min Avg. Time
850 Likes
Ln 1, Col 1
Smart Actions
💡 Explanation
AI Ready
💡 Suggestion Tab to accept Esc to dismiss
// Output will appear here after running code
Code Editor Closed
Click the red button to reopen