Problems > Total Covered Length > Editorial

Total Covered Length — Solution & Editorial

Back to the Problem

Merge overlapping intervals after sorting and sum (end − start) per merged block.

Complexity: O(N log N)