#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int tests = 1;
  cin >> tests;
  while (tests--) {
    int n, x;
    cin >> n;
    int arr[n];
    int i = 0, j = 0;
    for ((x) = 0; (x) < (int)(n); (x)++) {
      cin >> arr[x];
      if (arr[x] == 1) i = x, j = x;
    }
    int ma = 1;
    bool res[n + 1];
    memset(res, 0, sizeof(res));
    res[1] = 1;
    res[n] = 1;
    while (i - 1 >= 0 || j + 1 < n) {
      if (i - 1 >= 0 && j + 1 < n) {
        if (arr[i - 1] > arr[j + 1]) {
          ma = max(ma, arr[j + 1]);
          j++;
        } else {
          ma = max(ma, arr[i - 1]);
          i--;
        }
      } else if (i - 1 >= 0) {
        ma = max(ma, arr[i - 1]);
        i--;
      } else {
        ma = max(ma, arr[j + 1]);
        j++;
      }
      if (j - i + 1 == ma) {
        res[ma] = 1;
      }
    }
    for (x = 1; x <= n; x++) {
      cout << (res[x] ? "1" : "0");
    }
    cout << '\n';
  }
  return 0;
}
