#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,n) for(int i=0;i<n;i++)
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin >> t;
    while(t--){
    	ll n;
    	cin >> n;
    	vector<int> ans(n+1,0),cnt(n+1,0),a(n+1,0);
    	for(int i=1;i<=n;i++){cin >> a[i];cnt[a[i]]++;}
    	
    	if(cnt[1]>0){
    		ans[n]=1;
    	}
    	else{
    		f(i,n)cout << 0;
    		cout << endl;
    		continue;
    	}
    	int l=1;int r=n;
    	for(int i=n-1;i>=1;i--){
    		if(cnt[n-i+1]>0){
    			if(cnt[n-i+1-1]==1 && (a[l]==(n-i+1-1) || a[r]==(n-i+1-1)) && ans[i+1]==1)
    			{
    				ans[i]=1;
    				if(a[l]==(n-i+1-1))l++;
    				else r--;
    			}
    		}
    		else
    			break;
    	}
    	int f=0;
    	for(int i=1;i<=n;i++){
    		if(cnt[i]!=1)
    		{
    			f=2;
    			break;
    		}
    	}
    	if(f==0)ans[1]=1;
    	for(int i=1;i<=n;i++)cout << ans[i];
    	cout << endl;

    }


	return 0;
}