#include <bits/stdc++.h>
using namespace std;
const int sz = 2e5 + 5;
int a[sz];
int b[sz];
int i, j;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, l, r;
    cin >> n;
    string ans;
    for (i = 1; i <= n; i++) {
      cin >> a[i];
      b[a[i]] = i;
      ans += '0';
    }
    l = r = b[1];
    ans[0] = '1';
    for (i = 2; i <= n; i++) {
      if (b[i] < l) l = b[i];
      if (b[i] > r) r = b[i];
      if (r - l + 1 == i) ans[i - 1] = '1';
    }
    cout << ans << '\n';
  }
}
