[Python 3] deque solution
```\nclass Solution:\n    def maximumBinaryString(self, binary: str) -> str:\n        loc = deque([i for i, x in enumerate(binary) if not int(x)])\n        if n
```\nclass Solution:\n    def maximumBinaryString(self, binary: str) -> str:\n        loc = deque([i for i, x in enumerate(binary) if not int(x)])\n        if not loc: return binary\n\n        while len(loc) > 1:\n            cur = loc.popleft()\n            if loc:\n                loc.popleft()\n                loc.appendleft(cur+1)\n        \n        ans = [\'1\'] * len(binary)\n        ans[loc.popleft()] = \'0\'\n        return \'\'.join(ans)
['Python', 'Python3']