#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 5;
long long t, n, a[maxn];
map<long long, long long> mp;
string ans;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    ans = "";
    mp.clear();
    for (long long i = 1; i <= n; i++) {
      cin >> a[i];
      mp[a[i]] = i;
    }
    long long l = n + 1, r = -1;
    for (long long i = 1; i <= n; i++) {
      l = min(mp[i], l);
      r = max(mp[i], r);
      long long d = r - l + 1;
      if (d == i) {
        ans += '1';
      } else {
        ans += '0';
      }
    }
    cout << ans << endl;
  }
  return 0;
}
