Problems > How Many Intervals Cover X > Editorial

How Many Intervals Cover X — Solution & Editorial

Back to the Problem

Difference array over the coordinate range, prefix-summed once; each query is an array lookup.

Complexity: O(N + Q + C)