------
## 最终结论
```python
t = int(input())
for _ in range(t):
    n = int(input())
    p = list(map(int, input().split()))
    
    result = ['0'] * n
    min_index = n
    max_index = 0
    
    for i in range(n):
        min_index = min(min_index, p[i])
        max_index = max(max_index, p[i])
        
        if max_index - min_index == i:
            result[i] = '1'
    
    print(''.join(result))
```