C++ | Sliding window | Remove circular property first
```\nclass Solution {\npublic:\n    int minFlips(string s) {\n        int oddzero=0;\n        int evenzero=0;\n        int oddone=0;\n        int evenone=0;\n  
```\nclass Solution {\npublic:\n    int minFlips(string s) {\n        int oddzero=0;\n        int evenzero=0;\n        int oddone=0;\n        int evenone=0;\n        int n=s.size();\n        for(int i=0;i<n;i++){\n            s+=s[i];\n        }\n        for(int i=0;i<n;i++){\n            if(i%2==0){\n                if(s[i]==\'1\')evenone++;\n                else evenzero++;\n            }\n            else{\n                if(s[i]==\'1\')oddone++;\n                else oddzero++;\n            }\n        }\n        int ans=min(evenone+oddzero,evenzero+oddone);\n        for(int i=1;i<=n;i++){\n            if(s[i-1]==\'1\')evenone--;\n            else evenzero--;\n            int temp=evenone;\n            evenone=oddone;\n            oddone=temp;\n            temp=evenzero;\n            evenzero=oddzero;\n            oddzero=temp;\n            if(n%2==0){\n                if(s[i+n-1]==\'1\')oddone++;\n                else oddzero++;\n            }\n            else{\n                if(s[i+n-1]==\'1\')evenone++;\n                else evenzero++;\n            }\n            ans=min(ans,evenzero+oddone);\n            ans=min(ans,evenone+oddzero);\n        }\n        return ans;\n    }\n};
['C', 'Sliding Window']