3964. Minimum Lights to Illuminate a Road
LeetCodeOpen on judge ↗
You are given an integer array lights of length n, representing positions 0 through n - 1 on a road. For each position i: - If lights[i] = v, where v > 0, there is a working bulb at position i that illuminates every position from max(0, i - v) to min(n - 1, i + v), inclusive. - If lights[i] = 0, there is no working bulb at position i. A position is visible if it is illuminated by at least one
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.
Sign in to chat with the tutor and save your progress.
Sign in to start