#include <bits/stdc++.h>
using namespace std;
int tc;
int main(void) {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> tc;
  while (tc--) {
    long long int n;
    cin >> n;
    long long int a[n];
    long long int l, r;
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] == 1) {
        l = i;
        r = i;
      }
    }
    long long int mini = 1;
    long long int maxi = 1;
    long long int ans[n + 1];
    ans[1] = 1;
    for (long long int i = 2; i < n + 1; i++) {
      ans[i] = 0;
    }
    if (n == 1) {
      cout << "1" << endl;
    } else {
      while (l != 0 || r != n - 1) {
        if (l != 0 && r != n - 1) {
          if (a[l - 1] > a[r + 1]) {
            r++;
            if (a[r] > maxi) {
              maxi = a[r];
            }
          } else {
            l--;
            if (a[l] > maxi) {
              maxi = a[l];
            }
          }
        } else if (l == 0) {
          r++;
          if (a[r] > maxi) {
            maxi = a[r];
          }
        } else {
          l--;
          if (a[l] > maxi) {
            maxi = a[l];
          }
        }
        if (maxi - mini == r - l) {
          ans[maxi] = 1;
        }
      }
      ans[n] = 1;
      for (long long int i = 1; i < n + 1; i++) cout << ans[i];
      cout << endl;
    }
  }
}
