#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9;
int pos[N];
int a[N];
int ans[N];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) ans[i] = 0;
    int l, r, sum = 0;
    for (int i = 1; i <= n; ++i) {
      scanf("%d", a + i);
      pos[a[i]] = i;
    }
    ans[1] = 1;
    l = r = pos[1];
    sum = 1;
    for (int i = 2; i <= n; ++i) {
      ++sum;
      l = min(pos[i], l);
      r = max(pos[i], r);
      if (r - l + 1 == sum) ans[i] = 1;
    }
    for (int i = 1; i <= n; ++i) printf("%d", ans[i]);
    printf("\n");
  }
  return 0;
}
