Company: Capital One_3july
Difficulty: medium
Most Illuminated Point Problem Description Some lamps are placed on a coordinate line. Each lamp lights up a stretch of the line centred on its own coordinate. You are given a list lamps . Entry lamps[i] describes the i -th lamp: lamps[i][0] is the lamp's integer coordinate and lamps[i][1] is its effective radius, a positive integer. The i -th lamp illuminates every point in the range from lamps[i][0] - lamps[i][1] to lamps[i][0] + lamps[i][1] , both endpoints included. Find the coordinate of the point that is illuminated by the highest number of lamps. If several points are illuminated by that same highest number of lamps, report the smallest such coordinate. Input Format (inferred - the source describes a function that receives lamps and does not fix a stdin layout. The layout below is the one the question's stored starter code already reads.) The first line contains a single integer n , the number of lamps. Each of the next n lines contains two space-separated integers: lamps[i][0]