#include <bits/stdc++.h>
using namespace std;
int a[200005];
int mark[200005];
void solve() {
  int n, mx = 0, mn = 0, s;
  cin >> n;
  char res[200005];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 1) s = i;
    mark[a[i]] = i;
  }
  res[1] = '1';
  for (int i = 2; i <= n; i++) {
    int d = s - mark[i];
    if (d > mx) mx = d;
    if (d < mn) mn = d;
    if (mx - mn == i - 1)
      res[i] = '1';
    else
      res[i] = '0';
  }
  for (int i = 1; i <= n; i++) {
    cout << res[i];
  }
  cout << endl;
}
int main() {
  int n = 1;
  cin >> n;
  while (n--) solve();
  return 0;
}
