#include <bits/stdc++.h>
using namespace std;
bool chmin(long long& a, const long long& b) { return b < a ? a = b, 1 : 0; }
bool chmax(long long& a, const long long& b) { return a < b ? a = b, 1 : 0; }
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31 - __builtin_clz(x); }
const int N = 2e5 + 5;
void run_case() {
  int n;
  cin >> n;
  vector<int> a(n + 1), pref(n + 1), pos(N);
  int idx = -1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i], pref[i] = pref[i - 1] + a[i];
    if (a[i] == 1) {
      idx = i;
    }
    pos[a[i]] = i;
  }
  int l = idx, r = idx;
  string second = string(n, '0');
  second[0] = '1';
  vector<int> v = {idx};
  long long sum = 1;
  for (long long i = 2; i <= n; i++) {
    if (pos[i] < l) {
      while (l > pos[i]) {
        v.push_back(l - 1);
        sum += a[l - 1];
        l--;
      }
    } else {
      while (r < pos[i]) {
        v.push_back(r + 1);
        sum += a[r + 1];
        r++;
      }
    }
    if ((i * (i + 1)) / 2 == sum) {
      second[i - 1] = '1';
    }
  }
  cout << second << endl;
}
auto clk = clock();
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    run_case();
  }
  return 0;
}
