#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    map<int, int> ma;
    for (int i = 0; i < n; i++) {
      int val;
      cin >> val;
      ma[val] = i + 1;
    }
    string s = "";
    if (n == 1)
      cout << 1 << endl;
    else {
      int m = n;
      int M = 1;
      for (int i = 1; i < n; i++) {
        m = min(m, ma[i]);
        M = max(M, ma[i]);
        if (abs(m - M) == i - 1)
          s += '1';
        else
          s += '0';
      }
      cout << s + "1" << endl;
    }
  }
  return 0;
}
