#include <bits/stdc++.h>
#pragma GCC optimize "03"
using namespace std;
const long long int inf = INT_MAX;
const long long int MOD = 1e9 + 7;
const long long int N = 2e5 + 5;
long long int a[N];
long long int pos[N];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
      pos[a[i]] = i;
    }
    long long int mx = -inf, mn = inf;
    for (long long int i = 1; i <= n; i++) {
      mx = max(mx, pos[i]);
      mn = min(mn, pos[i]);
      if (mx - mn + 1 == i)
        cout << 1;
      else
        cout << 0;
    }
    cout << '\n';
  }
  return 0;
}
