func_code_string: #include <bits/stdc++.h>   using namespace std;   string s;   int main() {     int n, i, j, k, l, m;     cin >> n;     cin >> s;     int cnt, ans;     char c, c1, c2, c3;     ans = 0;     for (i = 0; i < n - 1; i++) {       cnt = 0;       if (s[i] == s[i + 1] && i < n - 1) {         c = s[i];         while (s[i] == c) {           i++;           cnt++;         }         ans += (cnt / 2);         if (i < n) c2 = s[i];         if (c2 ==  R  && c ==  B )           c1 =  G ;         else if (c2 ==  R  && c ==  G )           c1 =  B ;         else if (c2 ==  B  && c ==  G )           c1 =  R ;         else if (c2 ==  B  && c ==  R )           c1 =  G ;         else if (c2 ==  G  && c ==  B )           c1 =  R ;         else if (c2 ==  G  && c ==  R )           c1 =  B ;         if (i >= n) {           if (c ==  R )             c1 =  B ;           else if (c ==  B )             c1 =  G ;           else             c1 =  R ;         }         for (j = i - cnt + 1; j < i; j += 2) s[j] = c1;         i--;       }     }     printf( %d n , ans);     cout << s << endl;     return 0;   }   