Daily challenge for 2026-05-16
501. Maximum Interval Gap
Given an array of intervals where each interval is represented as [start, end], find the maximum gap between the end of one interval and the start of the next consecutive interval after sorting them by their start times. If an interval overlaps with or touches the previous one, the gap is considered 0. Return 0 if there are fewer than 2 intervals or if no positive gaps exist.
Example:
Input: intervals = [[1, 2], [10, 12], [5, 7]]
Output: 3
Run this challenge interactively in Python or JavaScript when the app loads.