#include <bits/stdc++.h>
using namespace std;
struct node {
  int a, b;
};
bool cmp(node n1, node n2) {
  if (n1.a == n2.a) {
    return n1.b < n2.b;
  }
  return n1.a < n2.a;
}
void solve() {
  int n;
  cin >> n;
  int A[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
  }
  int ans[n], p = -1;
  node arr[n + 1];
  int j = 0;
  for (int i = 1; i <= n; i++) {
    ans[i] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (A[i] == 1) {
      p = i;
      break;
    }
  }
  int maxr = 1, maxl = 1;
  for (int i = p + 1; i <= n; i++) {
    if (A[i] > maxr) {
      maxr = A[i];
      continue;
    } else {
      arr[j].a = A[i];
      arr[j].b = maxr - 1;
      j++;
    }
  }
  for (int i = p - 1; i >= 1; i--) {
    if (A[i] > maxl) {
      maxl = A[i];
    } else {
      arr[j].a = A[i];
      arr[j].b = maxl - 1;
      j++;
    }
  }
  sort(arr, arr + j, cmp);
  if (j != 0) {
    int low = arr[0].a, high = arr[0].b;
    for (int i = 1; i < j; i++) {
      if (arr[i].a <= high || (arr[i].a - 1) <= high) {
        high = max(high, arr[i].b);
      } else {
        for (int j = low; j <= high; j++) {
          ans[j] = 0;
        }
        low = arr[i].a;
        high = arr[i].b;
      }
    }
    for (int i = low; i <= high; i++) {
      ans[i] = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i];
  }
  cout << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
