Longest free time slot
Your task
Your workday runs from minute day_start to minute day_end. meetings is an unsorted list of [start, end] pairs occupying half-open spans [start, end), all within the day, possibly overlapping. Return the length of the longest uninterrupted free stretch in your day, or 0 if there is none. Example: a 0-480 day with meetings [[60,120],[240,300]] gives 180 (minutes 300 to 480).
Examples
longest_free_gap(meetings: list[list[int]], day_start: int, day_end: int) -> intExample 1
Input
longest_free_gap([[60, 120], [240, 300]], 0, 480)Output
180