#include <bits/stdc++.h>
using namespace std;
int n;
void update(int fen[], int p, int val) {
  for (int i = p; i <= n; i += i & -i) fen[i] += val;
}
int sum(int fen[], int p) {
  int ans = 0;
  for (int i = p; i; i -= i & -i) ans += fen[i];
  return ans;
}
void solve() {
  cin >> n;
  pair<int, int> a[n];
  for (int i = 0; i < n; i++) {
    int val;
    cin >> val;
    a[i] = make_pair(val, i + 1);
  }
  int fen[n + 1];
  for (int i = 0; i <= n; i++) fen[i] = 0;
  sort(a, a + n);
  int Max = 0, Min = n + 1;
  string ans(n, '0');
  for (int i = 0; i < n; i++) {
    Max = max(Max, a[i].second);
    Min = min(Min, a[i].second);
    update(fen, a[i].second, 1);
    if (sum(fen, Max) - sum(fen, Min - 1) == Max - Min + 1) ans[i] = '1';
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
