Medium · Intervals
Count intervals range
Given a list of inclusive integer intervals [start, end] in any order, return the number of distinct integers covered by at least one interval.
Examples
Example 1
[1,3] [2,6] [8,10] [9,11]Output: 10 covered
Example 2
[1,2] [3,4] [6,7]Output: 6 covered
Rebuild it in the studio
Open every published interview problem, solution, scene, and memory room free, with no account.