Solution Maximum Binary String After Change
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    public function maximumBinaryString($binary) {\n        $stOnes = 0;\n        $n = strlen($binary);\n        $i = 0;\n        $z = 0;\n\n        while ($i < $n && $binary[$i++] === \'1\') {\n            $stOnes++;\n        }\n\n        for ($x = 0; $x < $n; $x++) {\n            if ($binary[$x] === \'0\') {\n                $z++;\n            }\n            $binary[$x] = \'1\';\n        }\n\n        if ($stOnes < $n) {\n            $binary[$stOnes + $z - 1] = \'0\';\n        }\n\n        return $binary;\n    }\n}\n\n```
['PHP']