Sliding window
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n- O(2*n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\npublic class Solution {\n    public int MinFlips(string s) {\n        var n=s.Length;\n        int res = Int32.MaxValue, cur = 0;        \n        for (int i = 0; i < 2*n; i++)  {\n            if (s[i%n] - \'0\' == i%2) cur++; \n            if (i >= n && s[i%n] - \'0\' == i%n%2) cur--; \n            if (i >= n-1)  res = Math.Min(res, Math.Min(cur, n-cur));             \n        }\n        return res;\n    }\n}\n```
['C#']