FastPrepBrightest Position on a Street
Problems/Brightest Position on a Street

Brightest Position on a Street

Capital One logoCapital One● MediumNEW GRADFULLTIMEOA
QuestionFunctionExamplesConstraints

Problem statement

Source note: The report names the standard brightest-position interval task but omits the full runnable contract. The practice contract supplies conventional bounds and the smallest-coordinate tie rule.

Special thanks: 🌷 A special thank you to our lovely, amazing frenz who shared that this question appeared again on September 27, 2026! ദ്ദി ˉ͈̀꒳ˉ͈́ )✧ 💚

Each row [position, radius] in lights describes a street light at an integer coordinate. It illuminates every integer coordinate in the inclusive interval [position - radius, position + radius].

The brightness of a coordinate is the number of lights that illuminate it. Return the smallest coordinate having the maximum brightness.

Function

brightestPosition(lights: int[][]) → int

Examples

Example 1

lights = [[-3,2],[1,2],[3,3]]return = -1

Coordinate -1 is the smallest coordinate illuminated by the maximum of two lights.

Example 2

lights = [[1,0],[0,1]]return = 1

Coordinate 1 is illuminated by both lights.

Constraints

  • 1 <= lights.length <= 10^5
  • lights[i].length == 2
  • -10^8 <= position <= 10^8
  • 0 <= radius <= 10^8

More Capital One problems

  • Digit-Coded Card ValidationONSITE INTERVIEW · Seen Nov 2026
  • Rank Football TeamsOA · Seen Oct 2026
  • Count Subarrays Matching a Comparison PatternOA · Seen Oct 2026
All Capital One interview questionsSee Capital One hiring insights
Saved
public int brightestPosition(int[][] lights) {
  // write your code here
}
Checking account…