#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 50;
int id[maxn];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    int l, r, a;
    char s[maxn];
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      s[i] = '0';
      scanf("%d", &a);
      id[a] = i;
    }
    l = r = id[1];
    s[1] = '1';
    for (int i = 2; i <= n; i++) {
      l = min(l, id[i]);
      r = max(r, id[i]);
      if (r - l + 1 == i) s[i] = '1';
    }
    s[n + 1] = 0;
    printf("%s\n", s + 1);
  }
}
