leetle

Daily challenge for 2026-11-02

671. Overlapping Calendar Availability

You are given two schedules of available time intervals, firstList and secondList. Each list contains disjoint, sorted intervals of the form [start, end] representing half-open intervals [start, end).

Return the total duration during which both schedules are simultaneously available. Touching endpoints (such as [1, 3) and [3, 5)) have zero overlap duration.

Constraints:
Each calendar contains 0–1,000 intervals, sorted by start, with no internal overlap. Intervals are half-open [start,end), with integer endpoints and start < end. Adjacent intervals may touch. Every endpoint has absolute value at most 1,000,000.

Example:
Input: firstList = [[0, 2], [5, 10]], secondList = [[1, 5], [8, 12]]
Output: 3

Run this challenge interactively in Python or JavaScript when the app loads.