func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long INF = 9223372036854775807;   const long long N = 500005;   const long long mod = 1e9 + 7;   void start();   struct p {     long long a, b;   };   bool comp1(p p1, p p2) {     if (p1.a < p2.a) {       return true;     }     if (p1.a == p2.a) {       return (p1.b < p2.b);     }   };   struct CompareHeight {     bool operator()(struct p const& p1, struct p const& p2) {       return p1.a < p2.a;     }   };   long long vis[N], weight[N];   long long a[N], ans;   void dfs(long long node, long long target, long long m,            vector<pair<long long, long long> > adj[]) {     vis[node] = 1;     for (long long i = 0; i <= adj[node].size() - 1; i++) {       long long child = adj[node][i].first;       long long w = adj[node][i].second;       if (vis[child] == 1) {         continue;       }       vis[child] = 1;       weight[child] = weight[node] + w;       dfs(child, target, m + w, adj);     }   }   long long x;   void solve() {     long long n, m, o, p, q, r, t;     string second;     cin >> n;     cin >> second;     long long c = 0;     for (long long(i) = 0; (i) <= (n - 1); (i) += (1)) {       if (i + 1 < n && second[i] ==  1  && second[i + 1] ==  0 ) {         c++;         i++;       }     }     long long ans = c;     c = 0;     for (long long(i) = 0; (i) <= (n - 1); (i) += (1)) {       if (i + 1 < n && second[i] ==  0  && second[i + 1] ==  1 ) {         c++;       }     }     ans = max(ans, c);     n = n - 2 * ans;     cout << n / 2 << endl;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     ;     start();     long long query;     cin >> query;     while (query--) {       x++;       solve();     }   }   void start() {}   