#include <bits/stdc++.h>
const int maxn = 2e5 + 10;
const int maxm = 1e5 + 10;
const long long int mod = 1e9 + 7;
const long long int INF = 1e18 + 100;
const int inf = 0x3f3f3f3f;
const double pi = acos(-1.0);
const double eps = 1e-8;
using namespace std;
int n, m;
int cas, tol, T;
int a[maxn], p[maxn];
int fa[maxn];
int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }
void bind(int x, int y) {
  x = find(x), y = find(y);
  if (x == y) return;
  fa[x] = y;
  tol--;
  return;
}
int ok(int x) {
  tol++;
  int pos = p[x];
  if (pos > 1 && a[pos - 1] < x) {
    bind(a[pos - 1], a[pos]);
  }
  if (pos < n && a[pos + 1] < x) {
    bind(a[pos + 1], a[pos]);
  }
  return tol == 1;
}
int main() {
  scanf("%d", &T);
  while (T--) {
    tol = 0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      fa[i] = i;
    }
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      p[a[i]] = i;
    }
    for (int i = 1; i <= n; i++) {
      if (ok(i))
        printf("1");
      else
        printf("0");
    }
    puts("");
  }
  return 0;
}
