Find Point Illuminated by Most Lamps

Problem Overview

  • Determine the point on a number line covered by the most lamp ranges; on ties, return the smallest coordinate.
  • Input: array lamps where each element is [position, radius]; Output: the best coordinate as an integer.
  • Each lamp illuminates [position - radius, position + radius] inclusive on a 1D line.
  • Real-world context: choosing a location with maximal overlapping coverage.
  • From Uber interviews; this problem is a common coding interview topic and a frequent interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: