#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    int b[n + 1];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      b[a[i]] = i;
    }
    int l = n - 1;
    int r = 0;
    for (int i = 1; i <= n; i++) {
      int crr = i;
      int crrl = b[i];
      if (crrl < l) {
        l = crrl;
      }
      if (crrl > r) {
        r = crrl;
      }
      if (r - l <= crr - 1) {
        cout << "1";
      } else {
        cout << "0";
      }
    }
    cout << "\n";
  }
}
