1702. Maximum Binary String After Change.cpp
Code\n``\nclass Solution {\npublic:\n    string maximumBinaryString(string binary) {\n        int zeros = 0;\n        int n=binary.size();\n        string ans(n
**Code**\n``\nclass Solution {\npublic:\n    string maximumBinaryString(string binary) {\n        int zeros = 0;\n        int n=binary.size();\n        string ans(n,\'1\');\n        for (auto& c : binary) {\n            if (c == \'0\') {\n                ++zeros;\n            }\n        }\n        for (int i=0;i<n;i++) {\n            if (binary[i] == \'0\') {\n                ans[i+zeros-1]=\'0\';\n                return ans;\n            }\n        }        \n        return ans;\n    }\n};\n```
['C']