A perfectly straight street is represented by a number line. The street has street lamp(s) on it and is represented by a 2D integer array lights
. Each lights[i] = [positioni, rangei]
indicates that there is a street lamp at position positioni
that lights up the area from [positioni - rangei, positioni + rangei]
(inclusive).
The brightness of a position p
is defined as the number of street lamp that light up the position p
.
Given lights
, return the brightest position on the street. If there are multiple brightest positions, return the smallest one.
Example 1:
Input: lights = [[-3,2],[1,2],[3,3]]