#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
int a[maxn], id[maxn];
int main() {
  int q;
  cin >> q;
  while (q--) {
    string ans = "";
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]), id[a[i]] = i;
    int l = 1e9, r = 0, tot = 0;
    for (int i = 1; i <= n; i++) {
      l = min(l, id[i]), r = max(r, id[i]);
      if (r - l + 1 == i)
        ans += '1';
      else
        ans += '0';
    }
    cout << ans << endl;
  }
  return 0;
}
