------
## 最终结论
```python
t = int(input())
test_cases = []
for _ in range(t):
    n = int(input())
    s = input().strip()
    test_cases.append((n, s))

results = []

for n, s in test_cases:
    result = []
    for char in s:
        if char == '1' and result and result[-1] == '0':
            # Remove the last character (0) to maintain the cleanest string
            result.pop()
        else:
            result.append(char)
    # Join the result list to form the final clean string
    results.append(''.join(result))

for result in results:
    print(result)
```