#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  int n;
  int fn[200005] = {};
  int a, b, c;
  vector<string> st(t);
  for (int j = 0; j < t; j++) {
    cin >> n;
    int rn[n];
    for (int i = 0; i < n; i++) {
      cin >> rn[i];
      fn[rn[i]] = i + 1;
    }
    string s = "1";
    a = min(fn[1], fn[2]);
    b = max(fn[1], fn[2]);
    for (int i = 2; i <= n; i++) {
      c = fn[i];
      if (a >= c)
        a = c;
      else if (b <= c)
        b = c;
      if (b - a == i - 1)
        s.insert(i - 1, "1");
      else
        s.insert(i - 1, "0");
    }
    st[j] = s;
  }
  for (int j = 0; j < t; j++) {
    cout << st[j] << endl;
  }
  return 0;
}
