1758. Minimum Changes To Make Alternating Binary String Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 1758class Solution: def minOperations(self, s: str) -> int: cnt = sum(c != '01'[i & 1] for i, c in enumerate(s)) return min(cnt, len(s) - cnt)