| Winter Cup 6.0 Online Mirror Contest |
|---|
| Finished |
You are given a binary string of length $$$n$$$.
You can take two consecutive $$$1$$$s, remove them, and replace them with $$$0$$$.
Also, you can take two consecutive $$$0$$$s, remove them, and replace them with $$$1$$$.
You can do these operations any number of times (possibly zero).
You have to find the lexicographically largest string you can obtain.
A string $$$a$$$ is lexicographically smaller than a string $$$b$$$ if and only if one of the following holds:
The first line contains one integer $$$t$$$ $$$( 1 \le t \le 10^4):$$$ the number of test cases.
The first line of each test case contains one integer $$$n$$$ $$$(1 \le n \le 10^5):$$$ the length of the binary string $$$s$$$.
The second line of each test case contains a binary string consisting of $$$n$$$ characters.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\times 10^5$$$
For each test case, output $$$t$$$ : the lexicographically largest string you can obtain.
6600001061010006011000611010114010101010101001410101010110101
1110 110 110 110101 1 110101
| Name |
|---|


