Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Garland by eugene100372
def illuminate_all(lights: list[int]) -> int:
res=[float('-inf'),-1]
for start,end in sorted(((i-r,i+r) for i,r in enumerate(lights))):
if end>res[-1]:
if startlen(lights)-2: break
return len(res)-2
Aug. 19, 2023