#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
template <typename T>
inline T Bigmod(T base, T power, T MOD) {
  T ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n];
    map<int, int> ind;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      ind[arr[i]] = i + 1;
    }
    int l, r;
    l = ind[1];
    string s;
    s.push_back('1');
    if (n > 1) {
      int in = ind[2];
      if (in > l)
        r = in;
      else {
        r = l;
        l = in;
      }
      if ((r - l) <= 1)
        s.push_back('1');
      else
        s.push_back('0');
    }
    for (int i = 3; i <= n; i++) {
      int in = ind[i];
      if (in < l) {
        if ((r - in) < i) {
          s.push_back('1');
        } else {
          s.push_back('0');
        }
        l = in;
      } else if (in > r) {
        if ((in - l) < i) {
          s.push_back('1');
        } else {
          s.push_back('0');
        }
        r = in;
      } else {
        if ((r - l) < i)
          s.push_back('1');
        else
          s.push_back('0');
      }
    }
    cout << s << endl;
  }
  return 0;
}
