Problem 2250 · Medium

Count Number of Rectangles Containing Each Point

Bucket rectangles by height, sort each bucket by length, and count the rectangles that reach each point with a binary search.

Open the interactive visualisation