#include <bits/stdc++.h>
using namespace std;
int n, x, t, l, r;
int pos[200005];
int ans[200005];
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &x);
      pos[x] = i;
      ans[x] = 0;
    }
    l = pos[1];
    r = pos[1];
    ans[0] = 1;
    for (int i = 2; i <= n; i++) {
      if (pos[i] > r) r = pos[i];
      if (pos[i] < l) l = pos[i];
      if (r - l + 1 == i) ans[r - l] = 1;
    }
    for (int i = 0; i < n; i++) printf("%d", ans[i]);
    printf("\n");
  }
}
