#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n + 1];
    unordered_map<long long int, long long int> f;
    for (int i = 1; i < n + 1; i++) {
      cin >> a[i];
      f[a[i]] = i;
    }
    string ans;
    long long int l = n + 1, r = 0, x;
    for (int i = 1; i <= n; i++) {
      long long int y = i;
      l = min(l, f[i]);
      r = max(r, f[i]);
      x = (r - l + 1);
      if (x == y)
        ans += '1';
      else
        ans += '0';
    }
    cout << ans << endl;
  }
}
