#include <bits/stdc++.h>   #pragma GCC target( avx2 )   #pragma GCC optimization( O3 )   #pragma GCC optimization( unroll-loops )   using namespace std;   const int mod = 1e9 + 7;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int t;     cin >> t;     while (t--) {       long long n, m, a, b, i, j;       cin >> n;       deque<long long> dq, tmp;       long long ar[n], ans[n];       set<long long> s;       for (i = 0; i < n; i++) {         cin >> a;         ar[a - 1] = i;         ans[i] = 0;       }       a = n, b = 0;       for (i = 0; i < n; i++) {         a = min(a, ar[i]);         b = max(b, ar[i]);         if (b - a == i) ans[i] = 1;       }       for (i = 0; i < n; i++) cout << ans[i];       cout << endl;     }     return 0;   }   