#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(false), cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, a;
    cin >> n;
    int pl, pr, pone;
    int pos[n + 1];
    for (int i = 1; i <= n; i++) {
      cin >> a;
      if (a == 1) pl = i, pr = i, pone = i;
      pos[a] = i;
    }
    cout << 1;
    for (int i = 2; i <= n; i++) {
      if (pos[i] > pone)
        pr = max(pos[i], pr);
      else
        pl = min(pos[i], pl);
      if (abs(pl - pr) + 1 == i)
        cout << 1;
      else
        cout << 0;
    }
    cout << '\n';
  }
  return 0;
}
