Problem 4057 · Medium

Number of Intersecting Interval Pairs II

Count the disjoint pairs by sorting the starts, then subtract them from all pairs.

Open the interactive visualisation