#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
int run_test() {
  int n;
  cin >> n;
  vector<int> v(n), pos(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    pos[v[i]] = i + 1;
  }
  int mini = n + 1, maxi = 0;
  string ans = "";
  for (int i = 1; i <= n; i++) {
    mini = min(mini, pos[i]);
    maxi = max(maxi, pos[i]);
    if (maxi - mini == i - 1) {
      ans += '1';
    } else {
      ans += '0';
    }
  }
  cout << ans << "\n";
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tt;
  tt = 1;
  cin >> tt;
  while (tt--) {
    run_test();
  }
}
