A deployment scheduler uses a weekly calendar of 10,080 minutes. Minute 0 is Monday 00:00, and minute 10079 is Sunday 23:59. Each window is a half-open interval [start, end), including its start and excluding its end.
You are given an array of window records, inputCsv. Each record is a string in the form "<start>,<end>,<type>", where type is either "allowed" or "freeze". The array has no header row.
Windows may overlap or touch. A minute is deployable if it lies in at least one allowed window and in no freeze window.
Return every maximal continuous deployable window as a two-dimensional integer array of [start, end] pairs, sorted by increasing start time. Adjacent deployable periods form one window. If no minute is deployable, return an empty array.
Constraints:
- 0 ≤
inputCsv.length≤ 2,000. - 0 ≤
start<end≤ 10,080 for every window.
Example 1:
Input: inputCsv = ["30,70,allowed", "52,60,freeze", "10,40,allowed", "20,25,freeze", "70,85,allowed", "45,55,freeze"] Output: [[10, 20], [25, 45], [60, 85]] Explanation: The allowed windows combine into [10, 85). The freeze windows cover [20, 25) and [45, 60), leaving three maximal deployable windows.
Example 2:
Input: inputCsv = ["540,600,allowed", "570,585,freeze"] Output: [[540, 570], [585, 600]]
Example 3:
Input: inputCsv = ["100,120,allowed", "40,60,freeze", "10,30,allowed"] Output: [[10, 30], [100, 120]]
