#include <bits/stdc++.h>
using namespace std;
const long long inf = 2000000000000000000LL;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t, n, m, i, j, k, temp, flag, ans, mn, mx;
  cin >> t;
  while (t--) {
    cin >> n;
    map<long long, long long> mp;
    for (i = 1; i <= n; i++) {
      cin >> temp;
      mp[temp] = i;
    }
    for (i = 1, mn = n + 1, mx = 0; i <= n; i++) {
      mn = min(mn, mp[i]);
      mx = max(mx, mp[i]);
      if (mx - mn + 1 == i)
        cout << "1";
      else
        cout << "0";
    }
    cout << "\n";
  }
  return 0;
}
