func_code_string: #include <bits/stdc++.h>   using namespace std;   mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());   long long n;   long long len[1000005];   long long pai[1000005];   string s;   long long find(long long x) {     if (pai[x] == x) return x;     return pai[x] = find(pai[x]);   }   void merge(long long a, long long b) {     long long paiA = find(a), paiB = find(b);     pai[paiB] = paiA;   }   int32_t main() {     cin.tie(NULL);     cout.tie(NULL);     ios_base::sync_with_stdio(0);     cin >> n >> s;     long long p = 0, b = 0;     pai[0] = 0;     for (long long i = 1; i <= n; i++) {       pai[i] = i;       if (s[i - 1] ==  1 ) {         p++;         b = 0;       } else if (s[i - 1] ==  0 ) {         b++;         p = 0;       } else {         p++, b++;       }       len[i - 1] = max(p, b);     }     for (long long i = 1; i <= n; i++) {       long long res = 0, pos = 0;       while (pos < n) {         pos += i - 1;         while (pos < n and len[pos] < i) {           merge(pos + 1, pos);           pos = find(pos);         }         if (pos >= n) break;         pos++;         res++;       }       cout << res <<    ;     }     cout <<   n ;     return 0;   }   