#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, i;
    cin >> n;
    int a[200005];
    for (i = 0; i < n; i++) {
      int temp;
      cin >> temp;
      a[temp] = i;
    }
    int ps1 = a[1], ps2 = a[1];
    for (i = 1; i <= n; i++) {
      ps1 = min(a[i], ps1);
      ps2 = max(ps2, a[i]);
      if (ps2 - ps1 == (i - 1))
        cout << "1";
      else
        cout << "0";
    }
    cout << "\n";
  }
}
