Problems > Merged Timeline > Editorial

Merged Timeline — Solution & Editorial

Back to the Problem

Sort by start; extend the current block while the next interval starts within it (touching counts), else emit and restart.

Complexity: O(N log N)