← All problemsSign in

Lighting Rectangle

You are given an axis-aligned rectangle in a 2D Cartesian plane. The bottom left corner of this rectangle has coordinates $(0, 0)$ and the top right corner has coordinates $(N-1, N-1)$. You are also given $K$ light sources; each light source is a point inside or on the perimeter of the rectangle. For each light source, let's divide the plane into four quadrants by a horizontal and a vertical line

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start