(Golang) Tracking the previous zero. (True one pass solution)
\nfunc maximumBinaryString(binary string) string {\n\tpreviousZeroIndex := -1\n\tchArray := []byte(binary)\n\n\tfor i := 0; i < len(chArray); i++ {\n\t\tif chAr
```\nfunc maximumBinaryString(binary string) string {\n\tpreviousZeroIndex := -1\n\tchArray := []byte(binary)\n\n\tfor i := 0; i < len(chArray); i++ {\n\t\tif chArray[i] == \'0\' {\n\t\t\t// Case of 10 -> 01\n\t\t\t// Example (011110 -> 101111); indexOf [ previousZeroIndex = 0; previousZeroIndex+1 = 1; i = 5]\n            // We need to prefer operation 2 before operation 1 as it results in bigger number.\n\t\t\tif previousZeroIndex != -1 {\n\t\t\t\tchArray[previousZeroIndex] = \'1\'\n\t\t\t\tchArray[previousZeroIndex+1] = \'0\'\n\t\t\t\tchArray[i] = \'1\'\n\t\t\t\tpreviousZeroIndex++\n\t\t\t} else if i+1 < len(chArray) && chArray[i+1] == \'0\' {\n\t\t\t\t// Case of 00 -> 10\n\t\t\t\tchArray[i] = \'1\'\n\t\t\t} else {\n\t\t\t\t// Else we can update the position of the last zero\n\t\t\t\tpreviousZeroIndex = i\n\t\t\t}\n\t\t}\n\t}\n\treturn string(chArray)\n}\n\n\n```
['Go']