#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<long long, long long>, vector<pair<long long, long long> >,
               greater<pair<long long, long long> > >
    pq;
priority_queue<long long, vector<long long>, greater<long long> > pq1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, t, p;
  cin >> t;
  string s;
  while (t--) {
    cin >> n;
    vector<long long> arr(n);
    map<long long, long long> m;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      m[arr[i]] = i;
    }
    long long l, r;
    l = m[1];
    r = m[1];
    vector<long long> ans;
    ans.push_back(1);
    for (int i = 2; i <= n; i++) {
      long long p = m[i];
      if (p > r) r = p;
      if (p < l) l = p;
      if (r - l + 1 == i)
        ans.push_back(1);
      else
        ans.push_back(0);
    }
    for (int i = 0; i < n; i++) cout << ans[i];
    cout << "\n";
  }
  return 0;
}
