C++ Solution
Code\n\nclass Solution \n{\npublic:\n    string maximumBinaryString(string binary)\n    {\n        int stOnes=0, n=binary.size(), i=0, z=0;\n        while(i<n &
# Code\n```\nclass Solution \n{\npublic:\n    string maximumBinaryString(string binary)\n    {\n        int stOnes=0, n=binary.size(), i=0, z=0;\n        while(i<n && binary[i++]==\'1\') stOnes++;\n        for(int x=0; x<n; x++) \n        {\n            if(binary[x]==\'0\') z++;\n            binary[x]=\'1\';\n        }\n        if(stOnes<n) binary[stOnes+z-1]=\'0\';\n        return binary;\n    }\n};\n```
['C++']