Problem 2580 · Medium

Count Ways to Group Overlapping Ranges

Ranges that share a point must stay together, so merge them into components; each component can go either way.

Open the interactive visualisation