#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, k;
  map<int, int> m;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    m.clear();
    for (int i = 0; i < n; i++) {
      scanf("%d", &k);
      m[k] = i;
    }
    int l = m[1], r = m[1];
    for (int i = 1; i <= n; i++) {
      if (m[i] < l) {
        l = m[i];
      }
      if (m[i] > r) {
        r = m[i];
      }
      if (r - l < i)
        cout << 1;
      else
        cout << 0;
    }
    cout << endl;
  }
}
