Your question is Minimum Switches for Light Bulbs. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a binary array bulbs where 0 means off and 1 means on, find the minimum number of switch operations needed to turn all bulbs on. One switch operation at index i flips every bulb from i to the end of the array, changing 0 to 1 and 1 to 0. Return the minimum number of operations as an integer.
def min_switches(bulbs):