Leetcode 2250. Count Number of Rectangles Containing Each Point
For each query point, count how many origin-anchored rectangles (0,0)-(li,hi) satisfy li >= x and hi >= y. Key observation: heights are bounded (<=100), so bucket rectangles by height and use sorted lengths / prefix counts to quickly sum rectangles with li >= x across heights >= y.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Your account is free and you can post anonymously if you choose.