Problem 2494 · Hard

Merge Overlapping Events in the Same Hall

SQL teaching model. Within each hall, sort the inclusive day ranges, flag each range that starts after the furthest end so far, number the groups with a running sum, and collapse each group to its earliest start and latest end.

Open the interactive visualisation