
Operation 1: If the string contains the substring "00", the student can replace it with "10". For example, "00010" -> "10010"
Operation 2: If the string contains the substring "10", the student can replace it with "01". For example, "00010" -> "00001"
Let’s say we have bstring as “001” which is an integer 1 in decimal representation. If you apply the above-given operation then you will have bString as “101” which is an integer 5 in decimal representation.
The first line of input contains an integer ‘T’, denoting the number of test cases.
The first line of each test case contains a binary string ‘bString’ of 0’s and 1’s.
For each test case, print the greatest binary string you can obtain after applying the given operations.
Output for each test case is printed on a separate line.
You do not need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= N <= 10^5
The binary string will only consist of 0’s and 1’s as characters.
Where ‘T’ represents the number of test cases, ‘N’ represents the length of the binary string.
Time Limit: 1 sec