#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
const int maxn = 3e5 + 100;
int st[maxn*4] , arr[maxn];
bool pos[maxn];int n;

int build(int ss , int se , int index){
    if(ss == se){
        return st[index] = ss;
    }
    int mid = (ss+se)/2;
    int lf = build(ss,mid,index*2+1);
    int rf = build(mid+1,se,index*2+2);
    if(arr[lf] <= arr[rf]){
        return st[index] = lf;
    }
    else{
        return st[index] = rf;
    }
}

int query(int ss, int se, int qs, int qe, int index)
{
	if (qs <= ss && qe >= se)
		return st[index];

	if (se < qs || ss > qe)
		return -1;

	int mid = (ss+se)/2;
	int lf = query( ss, mid, qs, qe, 2*index+1);
	int rf = query(mid+1, se, qs, qe, 2*index+2);
	if(lf == -1)return rf;
	else if(rf == -1)return lf;
	if(arr[lf]<=arr[rf])
        return lf;
    else return rf;
}

void solve(int l , int r){
    if(l > r)return;
    int mn = query(0,n-1,l,r,0);
    if((r-l) >= (n-arr[mn])){
        pos[arr[mn]] = true;
        solve(l,mn-1);
        solve(mn+1,r);
    }
}

int main()
{
    fast;
    int test; cin >> test;
    while(test--){
        cin >> n;
        set<int>sdd;
        for(int i = 0; i<=n; i++)pos[i] = false;
        for(int i = 0; i<n; i++){
                cin >> arr[i];
                sdd.insert(arr[i]);
        }
        build(0,n-1,0);
        solve(0,n-1);
        for(int i = 2; i<=n; i++){
            pos[i] = pos[i-1]&pos[i];
        }
        if(sdd.size() == n)pos[n] = true;
        for(int i = 0; i<n; i++){
            cout << pos[n-i];
        }
        cout << endl;

    }
}
