#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << ' ' << *it << " = " << a;
  err(++it, args...);
}
const long long MOD = 1e9 + 7;
const int N = 1e6 + 9, M = 1e7, OO = 0x3f3f3f3f;
int arr[N];
int b[N];
int main() {
  int tc;
  scanf("%d", &tc);
  while (tc--) {
    int n;
    memset(b, 0, sizeof b);
    memset(arr, 0, sizeof arr);
    scanf("%d", &n);
    int mn = n + 1, mx = 0;
    for (int i = 0; i < n; ++i) {
      int x;
      scanf("%d", &x);
      arr[x] = i;
    }
    for (int i = 1; i <= n; ++i) {
      if (mn > arr[i]) mn = arr[i];
      if (mx < arr[i]) mx = arr[i];
      if ((mx - mn + 1) == i)
        b[i - 1] = 1;
      else
        b[i - 1] = 0;
    }
    for (int i = 0; i < n; ++i) printf("%d", b[i]);
    puts("");
  }
  return 0;
}
