#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<int, int> a, pair<int, int> b) {
  return (a.first < b.first) || (a.first == b.first && a.second > b.second);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n], p[n + 1];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      p[a[i]] = i + 1;
    }
    int l = n, r = 0;
    for (int i = 1; i <= n; i++) {
      l = min(l, p[i]);
      r = max(r, p[i]);
      if (r - l + 1 == i)
        cout << 1;
      else
        cout << 0;
    }
    cout << endl;
  }
}
