beautiful 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:\n    def maximumBinaryString(self, binary: str) -> str:\n        zero_count = binary.count("0") - 1\n        leftmost_zero = binary.find("0")\n        if leftmost_zero == -1:\n            return binary\n        adjust = min(len(binary) - 1, leftmost_zero + zero_count)\n\n        return "1" * adjust + "0" + "1" * ((len(binary) - 1) - adjust)\n\n```
['Python3']