#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const double PI = atan(1.0) * 4;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, -1, 0, 1};
const long long INF = (long long)2e18 + 50;
const int maximum = numeric_limits<int>::min();
const int minimum = numeric_limits<int>::max();
const long long mod = 1e9 + 7;
long long power(long long a, long long e) {
  long long res = 1LL;
  while (e > 0) {
    if (e % 2 == 1) res = res * a;
    a = a * a;
    e /= 2;
  }
  return res;
}
bool isBalanced(const string &exp) {
  bool flag = true;
  int count = 0;
  for (int i = 0; i < exp.length(); i++) {
    if (exp[i] == '(') {
      count++;
    } else {
      count--;
    }
    if (count < 0) {
      flag = false;
      break;
    }
  }
  if (count != 0) {
    flag = false;
  }
  return flag;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> p(n);
    vector<int> pos(n);
    for (int i = 0; i < n; i++) {
      cin >> p[i];
      --p[i];
      pos[p[i]] = i;
    }
    int pos_max = -1, pos_min = n + 1;
    vector<int> res(n);
    for (int i = 0; i < n; i++) {
      pos_max = max(pos_max, pos[i]);
      pos_min = min(pos_min, pos[i]);
      if (pos_max - pos_min == i)
        res[i] = 1;
      else
        res[i] = 0;
    }
    for (auto i : res) {
      cout << i;
    }
    cout << "\n";
  }
  return 0;
}
