You're handed someone's calendar for the day as a list of meeting time blocks, each a [start, end] pair. Implement intervalsMeetingCalendar(intervals), which returns true if the person can attend every meeting and false if any two of them collide. This is the classic meeting-rooms warm-up: one person, one body — so the only question is whether the schedule is conflict-free.
// intervals: an array of [start, end] pairs, each a half-open interval [start, end).
// "Half-open" means a meeting occupies start up to (but NOT including) end,
// so [1, 2) and [2, 3) merely touch and do NOT conflict. The list may be in
// any order; start <= end for every pair.
// returns: a boolean — true if no two meetings overlap, false otherwise.
function intervalsMeetingCalendar(intervals: [number, number][]): boolean;
// Two meetings overlap: [5, 10) starts at 5, while [0, 30) runs until 30.
intervalsMeetingCalendar([[0, 30], [5, 10]]);
// → false
// These two never share a moment, even though the input is out of order.
intervalsMeetingCalendar([[7, 10], [2, 4]]);
// → true
[start, end) — end-exclusive. So [1, 2) and [2, 3) butt up against each other but do not overlap; the back-to-back schedule is attendable.[1, 10) and [3, 5)) is a conflict, and two identical meetings are a conflict.true; there's nothing to clash with.