Java Simple and easy using sliding window solution solution, clean code with comments
PLEASE UPVOTE IF YOU LIKE THIS SOLUTION\n\n\n\nclass Solution {\n    public int minFlips(String s) {\n        /*\n        * Sliding Window Approach\n        */\
**PLEASE UPVOTE IF YOU LIKE THIS SOLUTION**\n\n\n```\nclass Solution {\n    public int minFlips(String s) {\n        /*\n        * Sliding Window Approach\n        */\n        \n        \n        int n = s.length();\n        \n        int mininumFlip = Integer.MAX_VALUE;\n        \n        int misMatchCount = 0;\n        for(int i = 0; i < (2 * n); i++){\n            \n            int r = i % n;\n            \n            //add mis watch count in current window\n            if((s.charAt(r) - \'0\') != (i % 2 == 0 ? 1 : 0)) misMatchCount++;\n            \n            //remove mismatch count which are not relvent for current window\n            if(i >= n && (s.charAt(r) - \'0\') != (r % 2 == 0 ? 1 : 0)) misMatchCount--;\n            \n            \n            //misMatchCount : when valid binary string start from 1\n            //n - misMatchCount : when valid binary string start from 0\n            if(i >= n - 1) mininumFlip = Math.min(mininumFlip, Math.min(misMatchCount, n - misMatchCount));\n        }\n        \n        return mininumFlip;\n    }\n}\n\n```
['Sliding Window', 'Java']