#include <bits/stdc++.h>
using namespace std;
int a[200005];
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      int t;
      cin >> t;
      a[t] = i;
    }
    int l, r, num;
    string s = "";
    for (int i = 1; i <= n; i++) {
      if (i == 1) {
        num = 0;
        l = r = a[i];
        s += '1';
        continue;
      }
      if (r < a[i])
        num += a[i] - r - 1, r = a[i];
      else if (l > a[i])
        num += l - a[i] - 1, l = a[i];
      else
        num--;
      if (!num)
        s += '1';
      else
        s += '0';
    }
    cout << s << endl;
  }
  return 0;
}
