#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    scanf("%d", &n);
    vector<int> v(n), mx(n, 0), inv(n + 1);
    int pos1;
    for (int i = 0; i < n; i++) {
      scanf(" %d", &v[i]);
      if (v[i] == 1) pos1 = i;
      inv[v[i]] = i;
    }
    for (int i = pos1 + 1; i < n; i++) {
      mx[i] = max(v[i], mx[i - 1]);
    }
    for (int i = pos1 - 1; i >= 0; i--) {
      mx[i] = max(v[i], mx[i + 1]);
    }
    string res = "1";
    for (int i = 2; i <= n; i++) {
      if (mx[inv[i]] == i) {
        res += '1';
      } else {
        res += '0';
        int val = mx[inv[i]] - 1;
        while (i <= n && i < val) {
          res += '0';
          i++;
          if (mx[inv[i]] != i) val = max(val, mx[inv[i]] - 1);
        }
      }
    }
    cout << res << endl;
  }
}
