#include <bits/stdc++.h>
using namespace std;
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
signed main() {
  fast();
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    unordered_map<long long, long long> mp;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      mp[a[i] - 1] = i;
    }
    long long l = n, r = 0;
    for (long long i = 0; i < n; i++) {
      l = min(l, mp[i]);
      r = max(r, mp[i]);
      if (r - l == i)
        cout << 1;
      else
        cout << 0;
    }
    cout << endl;
  }
  return 0;
}
