#include <bits/stdc++.h>
using namespace std;
int mod = int(1e9) + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> p(n + 1);
    for (int i = 1; i <= n; ++i) {
      int x;
      cin >> x;
      p[x] = i;
    }
    long long int pf[n + 1];
    pf[0] = 0;
    for (int i = 1; i <= n; ++i) {
      pf[i] = pf[i - 1] + i;
    }
    int i = p[1];
    int j = p[1];
    long long int s = p[1];
    vector<char> ans(n + 1);
    ans[1] = '1';
    for (int k = 2; k <= n; k++) {
      j = max(j, p[k]);
      i = min(i, p[k]);
      s += p[k];
      if ((pf[j] - pf[i - 1]) == s) {
        ans[k] = '1';
      } else {
        ans[k] = '0';
      }
    }
    for (int g = 1; g <= n; g++) {
      cout << ans[g];
    }
    cout << "\n";
  }
  return 0;
}
