#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1.0);
long long mod = 1e9 + 7;
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
long long prod(long long a, long long b) {
  long long res = 0;
  a %= mod;
  while (b) {
    if (b & 1ll) res = (res + a) % mod;
    a = (2ll * a) % mod;
    b >>= 1ll;
  }
  return res;
}
long long power(long long a, long long b) {
  long long res = 1ll;
  while (b > 0) {
    if (b % 2ll) res = (res * a) % mod;
    a = (a * a) % mod;
    b /= 2ll;
  }
  return res;
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  string ans = "";
  for (long long i = 0; i < n; i++) {
    ans.push_back('0');
  }
  long long x = n;
  long long i = 0, j = n - 1;
  vector<bool> vis(n + 1, false);
  while (i <= j) {
    while (x > 0 and vis[x]) x--;
    if (j - i + 1 == x) {
      ans[j - i] = '1';
    }
    vis[max(a[i], a[j])] = true;
    if (a[i] > a[j])
      i++;
    else
      j--;
  }
  cout << ans << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
