Easy||Greedy||C++
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```\nclass Solution {\npublic:\n    string maximumBinaryString(string s) {\n        int n=s.length();\n        if(n==1){\n            return s;\n        }\n        int count=0;\n        int i;\n        for(auto it:s){\n            if(it==\'0\'){\n                count++;\n            }\n        }\n        string ans="";\n        for(i=0;i<n;i++){\n            if(s[i]==\'0\'){\n                break;\n            }\n            else{\n                ans+=s[i];\n            }\n        }\n        if(i==n){\n            return ans;\n        }\n        while(count>1){\n            ans+=\'1\';\n            count--;\n            i++;\n\n        }\n        ans+=\'0\';\n        int x=ans.length();\n        x=n-x;\n        while(x>0){\n            ans+=\'1\';\n            x--;\n        }\n        return ans;\n\n\n        \n    }\n};\n```
['C++']