Easy CPP solution | Greedy
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 binary) {\n        int cnt = 0;\n        int n = binary.size();\n        for(int i=0; i<n; i++){\n            cnt += binary[i]==\'0\' ? 1 : 0;\n        }\n        if(cnt<=1){\n            return binary;\n        }\n        int index = -1;\n        for(int i=0; i<n; i++){\n            if(binary[i]==\'0\' && index==-1){\n                index = i;\n            }\n            binary[i] = \'1\';\n        }\n        // if(index==-1){\n        //     return binary;\n        // }\n        binary[index+cnt-1] = \'0\';\n        return binary;\n    }\n};\n```
['Greedy', 'C++']