#include <bits/stdc++.h>
using namespace std;
void printi(vector<int> &l) {
  for (int i = 0; i < l.size(); ++i) {
    cout << l[i] << " ";
  }
  cout << endl;
}
void printl(vector<long long> &l) {
  for (int i = 0; i < l.size(); ++i) {
    cout << l[i] << " ";
  }
  cout << endl;
}
template <class T>
istream &operator>>(istream &in, vector<T> &arr) {
  for (T &i : arr) {
    in >> i;
  }
  return in;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  long long a;
  cin >> a;
  for (int i = 0; i < a; ++i) {
    long long b;
    cin >> b;
    string s = "";
    map<long long, long long> c;
    for (int i = 0; i < b; ++i) {
      long long k;
      cin >> k;
      c[k] = i;
    }
    long long ma = c[1];
    long long mi = c[1];
    for (int i = 1; i <= b; ++i) {
      long long u = c[i];
      if (u > ma) ma = u;
      if (u < mi) mi = u;
      if (ma - mi == i - 1)
        s += "1";
      else
        s += "0";
    }
    cout << s << endl;
    ;
  }
}
