Beats 100% | Counting all zero, in the end only one zero stays
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<!-- 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```cpp []\nclass Solution {\npublic:\n    string maximumBinaryString(string s) {\n        int n = s.size();\n        int zero=0;\n        int ind=-1;\n        for(int i=0;i<n;i++){\n            if(s[i]==\'0\'){\n                ind=i;\n                break;\n            }\n        }\n        for(auto x:s){\n            if(x==\'0\'){\n                zero++;\n            }\n        }\n        if(zero<=1){\n            return s;\n        }\n        ind = ind+zero-1;\n        string ans(n,\'1\');\n        ans[ind]=\'0\';\n        return ans;\n    }\n};\n```
['C++']