#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int number;
  cin >> number;
  while (number--) {
    int many;
    cin >> many;
    int arr[many];
    for (int i = 0; i < many; i++) {
      int temp;
      cin >> temp;
      arr[--temp] = i;
    }
    bool condition[many];
    int left = many, right = 0;
    for (int i = 0; i < many; i++) {
      left = min(left, arr[i]);
      right = max(right, arr[i]);
      if (right - left == i)
        condition[i] = 1;
      else
        condition[i] = 0;
    }
    for (int i = 0; i < many; i++) cout << condition[i];
    cout << endl;
  }
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << " ms\n";
  return 0;
}
