func_code_string: #include <bits/stdc++.h>   using namespace std;   int f[(1 << 20)], cnt[(1 << 20)], n, m;   string s;   int main() {     cin >> n >> m >> s;     fill(f + 1, f + (1 << m), INT_MAX);     for (int i = 1; i < n; i++) {       int a = s[i - 1] -  a , b = s[i] -  a ;       if (a != b) cnt[(1 << a) | (1 << b)]++;     }     for (int i = 0; i < (1 << m); i++) {       int c = m - __builtin_popcount(i);       for (int j = 0; j < m; j++) {         if ((i & (1 << j)) == 0) {           int num = f[i];           for (int k = 0; k < m; k++) {             int flag = 1;             if (i & (1 << k)) flag = -1;             num += flag * cnt[(1 << k) | (1 << j)] * c;           }           f[i | (1 << j)] = min(f[i | (1 << j)], num);         }       }     }     cout << f[(1 << m) - 1] << endl;     return 0;   }   