func_code_string: #include <bits/stdc++.h>   using namespace std;   int abs(int a, int b) {     if (a > b)       return a - b;     else       return b - a;   }   int main() {     int n, c, i, b, count = 0, index1 = 1, index2 = 1, flag = 0;     cin >> n >> c;     char *s;     s = new char[n + 2];     for (i = 1; i <= n; i++) {       cin >> s[i];     }     int *d = new int[n + 1];     for (i = 1; i <= n / 2; i++) {       b = abs((int)s[i], (int)s[n - i + 1]);       if (b < 13)         d[i] = d[n - i + 1] = b;       else         d[i] = d[n - i + 1] = 26 - b;     }     if (c > n / 2) c = 1 + n - c;     for (i = 1; i <= n / 2; i++) {       if (d[i] > 0) {         index1 = i;         break;       }     }     for (i = n / 2; i >= 1; i--) {       if (d[i] > 0) {         index2 = i;         flag = 1;         break;       }     }     if (c <= index1) {       count = index2 - c;     } else if (c <= index2) {       if (c - index1 > index2 - c)         count = 2 * (index2 - c) + c - index1;       else         count = 2 * (c - index1) + index2 - c;     } else       count = c - index1;     for (i = index1; i <= index2; i++) {       count += d[i];     }     if (flag == 1)       cout << count;     else       cout << 0;     return 0;   }   