leetle

Daily challenge for 2026-06-16

532. Find Free Time Gaps

You are given a list of time intervals representing busy periods in a day, where each interval is an array [start, end]. Return the total number of free time gaps between the busy periods. A gap exists if there is strictly positive time between the end of one busy period and the start of the next, after merging any overlapping busy periods.

Example:
Input: intervals = [[1, 3], [4, 6], [8, 10], [2, 4]]
Output: 1
Explanation: Merging the intervals gives [[1, 6], [8, 10]]. There is 1 gap between 6 and 8.

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