Interview Guides

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.
1 <= bulbs.length <= 10^5bulbs[i] is either 0 or 1i flips all bulbs in the suffix bulbs[i:]