#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int oo = 1e8;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<pair<int, int> > v(n);
    for (int i = 0; i < (int)n; i++) cin >> v[i].first, v[i].second = i;
    sort(v.begin(), v.end());
    int mini = 1e9, maxi = -1e9;
    for (int i = 0; i < (int)n; i++) {
      mini = min(v[i].second, mini);
      maxi = max(v[i].second, maxi);
      cout << ((maxi - mini) == i);
    }
    cout << endl;
  }
  return 0;
}
