#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int one = -1, n;
    cin >> n;
    unordered_map<int, int> s;
    int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      s[a[i]] = i;
    }
    string ans = "1";
    int l = s[1], r = s[1];
    for (int i = 2; i <= n; i++) {
      l = min(l, s[i]);
      r = max(r, s[i]);
      if (r - l + 1 != i) {
        ans += '0';
      } else
        ans += '1';
    }
    cout << ans << endl;
  }
}
