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