#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> pos(n + 1), a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    pos[a[i]] = i;
  }
  vector<int> ans(n + 1);
  ans[1] = 1;
  ans[n] = 1;
  int mx = pos[1], mn = pos[1];
  for (int i = 2; i <= n - 1; i++) {
    mx = max(pos[i], mx);
    mn = min(pos[i], mn);
    if (mx - mn + 1 == i) {
      ans[i] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i];
  }
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) solve();
}
