#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> vec(n + 1);
  map<int, int> mp;
  for (int i = 1; i <= n; i++) {
    cin >> vec[i], mp[vec[i]] = i;
  }
  int l = n, r = 1;
  for (int i = 1; i <= n; i++) {
    l = min(l, mp[i]), r = max(r, mp[i]);
    if (r - l + 1 == i) {
      cout << 1;
    } else {
      cout << 0;
    }
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve(), cout << endl;
  }
  return 0;
}
