#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n + 1], b[n + 1];
    a[0] = 0;
    b[0] = 0;
    int be[n + 1];
    be[0] = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      b[a[i]] = i;
      be[i] = 0;
    }
    be[1] = 1;
    be[n] = 1;
    int min = b[1];
    int max = b[1];
    for (int i = 2; i <= n; i++) {
      if (b[i] > max) {
        max = b[i];
      }
      if (b[i] < min) {
        min = b[i];
      }
      if (max - min == i - 1) {
        be[i] = 1;
      }
    }
    for (int i = 1; i <= n; i++) {
      cout << be[i];
    }
    cout << endl;
  }
}
