#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int pos[n + 1];
    for (int i = 1; i <= n; i++) {
      int k;
      cin >> k;
      pos[k] = i;
    }
    int l = n + 1, r = 0;
    string s = "";
    for (int i = 1; i <= n; i++) {
      l = min(l, pos[i]);
      r = max(r, pos[i]);
      if (1 + (r - l) == i)
        s += '1';
      else
        s += '0';
    }
    cout << s << "\n";
  }
  return 0;
}
