//Be Name Khoda

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define pb push_back
#define pp pop_back
#define all(x) x.begin(), x.end()

const ll mxn = 3e5 + 5;
ll t, n = 0, k, q;
ll cnt[mxn];
vector<ll> v, v2;

void input() {

    for(int i = 0; i <= n; i++) {
        cnt[i] = 0;
    }

    v.clear(), v2.clear();

    cin >> n;

    for(int i = 0; i < n; i++) {
        cin >> q; 
        v.pb(q);
        cnt[q]++;
    }

}


void solve() {

    ll l = 0, r = n - 1;

    if(cnt[1] > 0) {
        v2.pb(1);
    }

    for(int i = 2; i < n; i++) {
        if(cnt[1] == 0 || cnt[i] == 0 || cnt[i - 1] > 1) {
            break;
        }
        if(v[l] == i - 1) {
            v2.pb(1);
            l++;
        }
        else if(v[r] == i - 1) {
            v2.pb(1);
            r--;
        }
        else {
            break;
        }
    }

    while(v2.size() < n - 1) {
        v2.pb(0);
    }

    bool check = 1;

    for(int i = 1; i <= n; i++) {
        if(cnt[i] != 1) {
            check = 0;
            break;
        }
    }

    if(n > 1) {
        if(!check) {
            v2.pb(0);
        }
        else {
            v2.pb(1);
        }
    }

    for(int i = v2.size() - 1; i > -1; i--) {
        cout << v2[i];
    }
    cout << endl;

}

int main() {

    ios::sync_with_stdio(false);

    cin >> t;

    while(t--) {
        input(), solve();
    }
    
    return 0;
    
}