#3439
Reschedule Meetings for Maximum Free Time I
specialist · 815 · lc medium +31 · 53.9% accepted · 637 likes · top 45%
Description
You are given an integer eventTime representing the total duration of an event (from time t = 0 to t = eventTime).
You are also given two arrays startTime and endTime, each of length n, representing n non-overlapping meetings where the ith meeting runs during [startTime[i], endTime[i]].
Reschedule at most k meetings (shifting their start time while keeping their duration), maintaining relative order and non-overlap, to maximize the longest continuous free period during the event.
Meetings must remain within the event window.
Return the maximum free time achievable.
Code
1
2
3