#include <bits/stdc++.h>
using namespace std;
int a[200005];
int f[200005];
int main() {
  ios::sync_with_stdio(false);
  int t, n;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> n;
    int maxx = 0;
    int minx = 999999999;
    for (int j = 0; j < n; j++) {
      cin >> a[j];
      f[a[j]] = j;
    }
    for (int j = 1; j <= n; j++) {
      maxx = max(maxx, f[j]);
      minx = min(minx, f[j]);
      if (maxx - minx == j - 1) {
        cout << 1;
      } else
        cout << 0;
    }
    cout << endl;
  }
  return 0;
}
