Light Bulbs in Circle
Medium mathematics interview practice: Light Bulbs in Circle.
Light bulbs numbered 1 through n are arranged in a circle, all initially on. At time t, if bulb t (mod n) is on, you toggle bulb t+1 (mod n). If bulb t is off, you do nothing. What eventually happens?