You are given a lights of length n, representing a road with n consecutive positions indexed from n
An existing light at index i has an illumination radius of lights[i]. When lights[i] > 0, it illuminates all positions from lights[i]n lights[i]lights[i] = 0, there is no initial light active at index i.
You may install additional lights at any position. Each newly installed light has an illumination radius of n
Return the minimum number of additional lights needed so that every position from n
Constraints:
n lights.length
lights[i] n
You are given a lights of length n, representing a road with n consecutive positions indexed from n
An existing light at index i has an illumination radius of lights[i]. When lights[i] > 0, it illuminates all positions from lights[i]n lights[i]lights[i] = 0, there is no initial light active at index i.
You may install additional lights at any position. Each newly installed light has an illumination radius of n
Return the minimum number of additional lights needed so that every position from n
Constraints:
n lights.length
lights[i] n