Garland

Garland

You are given a sequence lights, where each integer is a distinct light with its brightness. This value determines how many adjacent positions to both left and right the illumination from that light reaches, in addition to illuminating the position of that light itself. (A light whose brightness is zero will therefore illuminate only itself, but doesn’t have anything to shine on its neighbors).

Your task is to turn on as few individual lights as possible so that every position of the entire row is illuminated by at least one light. Since the smallest working subset of lights is not necessarily unique, your function...

You should be an authorized user in order to see the full description and start solving this mission.