#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f;
const int N = 200010;
int a[N], pos[N], ans[N];
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    int st;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      pos[a[i]] = i;
      if (a[i] == 1) st = i;
    }
    int l = 0, r = 0;
    for (int i = 1; i <= n; i++) ans[i] = 0;
    for (int i = 1; i <= n; i++) {
      l = min(l, pos[i] - st);
      r = max(r, pos[i] - st);
      if (r - l + 1 == i) {
        ans[i] = 1;
      }
    }
    for (int i = 1; i <= n; i++) cout << ans[i];
    cout << endl;
  }
}
