• + 1 comment

    I think everyone including editorial did not consider the fact the When some button is pressed, all the bulbs at a distance from bulb will be toggled(off->on, on->off).

    I think everyone (inlucding me ) did not takethis into account. for example

    if array is 0 1 2 3 4 5 6 7 8 and K is 2, with brute force, when you turn off the light at 0th index, it will stop switches until index 2 and next switch to turn off is the one at index 5 which will turn off all the switched upto index 7 and now if you try to turn off 8, it will turn on 6 & 7.

    Is my understanding correct? Am I missing something here?