Nothing But Greedy Only
Intuition\nWe will try to convert maximum number of zero into one.\n\nObservations  ->  using the operations we can convert \n\n111110  -> 011111\n100000  -> 00
# Intuition\n**We will try to convert maximum number of zero into one.\n\nObservations  ->  using the operations we can convert \n\n111110  -> 011111\n100000  -> 000001\n000000  -> 111110\n\n\nSo, basically the position of zero is not of great importance here, we can bring all the zero at one place. And then perform the necessary operations**\n\n\n\n```\nclass Solution {\npublic:\n    string maximumBinaryString(string binary) {\n\n\n        int n = binary.size();\n        int zero = 0;\n\n        for(int i = 0; i < n; i++) {\n            if(binary[i] == \'0\') zero++;\n        }\n\n        string ans = "";\n\n        for(int i = 0; i < n; i++) {\n            ans += \'1\';\n        }\n\n        for(int i = 0; i < n; i++) {\n            if(binary[i] == \'0\') {\n                int poss = i + zero - 1;\n                ans[poss] = \'0\';\n                break;\n            }\n        }\n\n\n        return ans;\n    }\n};\n```
['C++']