Nearest Light

We, iuian develop a virtual vertical line with infinite length are numbered starting from zero from left to right. At every integer point of the vertical line, there is a bulb. Initially all the bulbs are turned on.


This is a companion discussion topic for the original entry at https://toph.co/p/nearest-light

Is it possible to solve it using python?