C++ || sliding Window || O(N)
\n int minFlips(string s) {\n        //using sliding window technique\n        int n = s.size(), res =INT_MAX, ans1 =0, ans2=0;\n        string s1 , s2;\n      
```\n int minFlips(string s) {\n        //using sliding window technique\n        int n = s.size(), res =INT_MAX, ans1 =0, ans2=0;\n        string s1 , s2;\n        s = s+s;\n\t\t//create 2 string stirng  of size s+s\n        for(int i =0;i<s.size();i++)\n        {\n            s1 += i%2 == 0 ? \'0\' :\'1\';   // 0101010101... \n            s2 += i%2 == 0 ? \'1\' : \'0\';  //1010101010...\n        }\n        \n        for(int i=0;i<s.size();i++)\n        {\n            if(s1[i] != s[i]) ans1++; \n            if(s2[i] != s[i]) ans2++; \n            \n            if(i >= n){\n                //decrement the prev if it was a part of res\n                if(s1[i-n] != s[i-n]) ans1--;\n                if(s2[i-n] != s[i-n]) ans2--;\n            }\n            if(i >= n-1)\n                res = min(res, min(ans1, ans2));\n        }\n        \n        return res;\n    }\n```
['C']