Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Greedy solution in Clear category for Garland by amandel
def illuminate_all(lights: list[int]) -> int:
intervals=[(i-l,i+l) for i,l in enumerate(lights)]
cnt=0
rg=0
# This loop is quadratic. Upon appropriate sorting of
# intervals, it can be made linear.
while rg
June 30, 2023