#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, tc;
  cin >> t;
  for (tc = 0; tc < t; tc++) {
    int n, i;
    cin >> n;
    vector<int> v(n), mx(n + 1, 0), mn(n + 1, n + 5);
    for (i = 0; i < n; i++) {
      cin >> v[i];
      mx[v[i]] = i;
      mn[v[i]] = i;
    }
    for (i = 2; i <= n; i++) {
      mx[i] = max(mx[i - 1], mx[i]);
      mn[i] = min(mn[i - 1], mn[i]);
    }
    for (i = 1; i <= n; i++) {
      if (mx[i] - mn[i] == i - 1) {
        cout << '1';
      } else {
        cout << '0';
      }
    }
    cout << '\n';
  }
  return 0;
}
