#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> ar(n);
    vector<bool> ans(n + 1, false);
    vector<long long> pos(n + 1, 0);
    for (long long i = 0; i < n; i++) {
      cin >> ar[i];
      pos[ar[i]] = i;
    }
    ans[1] = true;
    long long mn = pos[1];
    long long mx = pos[1];
    for (long long i = 2; i <= n; i++) {
      mn = min(mn, pos[i]);
      mx = max(mx, pos[i]);
      if (mx - mn + 1 <= i) ans[i] = true;
    }
    for (long long i = 1; i <= n; i++) {
      if (ans[i])
        cout << "1";
      else
        cout << "0";
    }
    cout << "\n";
  }
  return 0;
}
