#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n + 1];
    a[0] = 0;
    long long b[n + 1];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      b[a[i]] = i + 1;
    }
    b[0] = 0;
    long long l = b[1], r = b[1];
    string ans = "1";
    for (long long i = 2; i <= n; i++) {
      if (b[i] > r) r = b[i];
      if (b[i] < l) l = b[i];
      if ((r - l + 1) == i)
        ans += "1";
      else
        ans += "0";
    }
    cout << ans << endl;
  }
  return 0;
}
