#include <bits/stdc++.h>
using namespace std;
int t, n, a[200010], pos[200010];
bool found[200101], ans[200010];
void solve() {
  cin >> n;
  int posl, posr;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    pos[a[i]] = i;
    found[i] = ans[i] = false;
    if (a[i] == 1) posl = posr = i;
  }
  found[1] = ans[1] = true;
  int point = 1, maxfound = 1;
  for (int i = 2; i <= n; ++i) {
    if (found[i]) continue;
    if (pos[i] < posl) {
      for (posl = posl - 1; posl > pos[i]; --posl) {
        found[a[posl]] = true;
        maxfound = max(maxfound, a[posl]);
      }
    } else {
      for (posr = posr + 1; posr < pos[i]; ++posr) {
        found[a[posr]] = true;
        maxfound = max(maxfound, a[posr]);
      }
    }
    found[i] = true;
    maxfound = max(maxfound, i);
    while (point <= n && found[point]) point++;
    point--;
    if (maxfound == point) ans[point] = true;
  }
  for (int i = 1; i <= n; ++i) cout << ans[i];
  cout << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> t;
  while (t--) solve();
  return 0;
}
