1529. Minimum Suffix Flips

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1529

class Solution:
    def minFlips(self, target: str) -> int:
        res = 0
        for v in target:
            if (res & 1) ^ int(v):
                res += 1
        return res