#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long int n, i, j, k, sol, count = 0, diff = 0, ans = 1;
    cin >> n;
    vector<long int> v(n);
    unordered_map<long int, long int> m;
    for (i = 0; i < n; i++) {
      cin >> v[i];
      m[v[i]] = i;
    }
    long int max_pos = m[1];
    long int min_pos = m[1];
    string s = "1";
    for (i = 2; i <= n; i++) {
      max_pos = max(max_pos, m[i]);
      min_pos = min(min_pos, m[i]);
      if (max_pos - min_pos == i - 1)
        s.push_back('1');
      else
        s.push_back('0');
    }
    cout << s << '\n';
  }
  return 0;
}
