GREEDY MANIPULATE STRING
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![image.png](https://assets.leetcode.com/users/images/53533f96-473a-4639-bedb-2a3bf399c3f6_1717884682.0847397.png)\n\n# Code\n```\nclass Solution {\npublic:\n    string maximumBinaryString(string s) {\n        // SOLUTION OF TIN LE\n        ios_base::sync_with_stdio(false);\n        cin.tie(nullptr);\n        cout.tie(nullptr);\n        int n = s.size();\n        int last = n - 1;\n        for(int i = 0, start = -1; i < n; i++)\n        {\n            if(start == -1 && i && s[i - 1] == \'0\' && s[i] == \'1\') start = i;\n            if(s[i] == \'0\' && start != -1) swap(s[i], s[start++]);\n        }\n        for(int i = 0; i < n - 1; i++)\n        {\n            if(s[i] == \'0\' && s[i + 1] == \'0\') s[i] = \'1\';\n        }\n        return s;\n    }\n};\n```
['Greedy', 'C++']