#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  set<int> s;
  int a[n + 5];
  for (long long int i = 1; i < n + 1; i++) {
    int x;
    cin >> x;
    a[x] = i;
  }
  for (long long int i = 1; i < n + 1; i++) {
    s.insert(a[i]);
    auto it1 = s.begin();
    auto it2 = s.end();
    it2--;
    if ((*it2) - (*it1) + 1 == i)
      cout << 1;
    else
      cout << 0;
  }
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  cin >> TESTS;
  while (TESTS--) {
    solve();
  }
  return 0;
}
