<filename>Leetcode/1529. Bulb Switcher IV/solution1.py<gh_stars>10-100
class Solution:
    def minFlips(self, target: str) -> int:
        result = 0
        t = 1
        for c in target:
            if c == t:
                t ^= 1
                result += 1
        return result

<filename>Leetcode/1529. Bulb Switcher IV/solution1.py<gh_stars>10-100
class Solution:
    def minFlips(self, target: str) -> int:
        result = 0
        t = 1
        for c in target:
            if c == t:
                t ^= 1
                result += 1
        return result
