I am given a binary string binary consisting of only 0's or 1's. There are two allowed operations (can be re-used any number of times):
Operation 1: If the number contains the substring "00", can replace it with "10". For example, "00010" -> "10010"
Operation 2: If the number contains the substring "10", can replace it with "01". For example, "00010" -> "00001"
What is the maximum binary string I can obtain after any number of operations? Binary string x is greater than binary string y if x's decimal representation is greater than y's decimal representation.
I'm trying greedy ways to replace every "00" to "10", and don't see how to make use of "10" -> "01" path, but this breaks the input like "000110". How should I approach this problem instead?