#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void c_p_c() {}
const long long N = 2e5;
bool check(long long x, long long sum, vector<long long> a) {
  long long i;
  long long diff = 0;
  for (i = 0; i < a.size(); i++) {
    diff += abs(a[i] - x);
  }
  return (2 * diff) <= sum;
}
long long bin_s(long long l, long long r, long long sum, vector<long long> a) {
  long long m;
  while (l < r) {
    m = (l + r);
    m /= 2;
    if (check(m, sum, a)) {
      break;
    } else {
      r = m - 1;
    }
  }
  return m;
}
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  long long i;
  map<long long, long long> ma;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    ma[a[i] - 1] = i;
  }
  long long l = n;
  long long r = 0;
  string res = "";
  for (i = 0; i < n; i++) {
    l = min(l, ma[i]);
    r = max(r, ma[i]);
    if (r - l == i)
      res += '1';
    else
      res += '0';
  }
  cout << res << endl;
}
int32_t main() {
  c_p_c();
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) solve();
}
