func_code_string: #include <bits/stdc++.h>   using namespace std;   int f[1 << 21], a[210000], i, j, minn, ans, n, l, k;   char c[22];   void Min(int &x, int y) {     if (y < x) x = y;   }   int main() {     scanf( %d , &n);     for (i = 1; i <= n; ++i) {       scanf( %s , c + 1);       l = strlen(c + 1);       for (j = 1; j <= l; ++j) a[i] = a[i] * 2 + c[j] - 48;     }     memset(f, 3, sizeof(f));     f[1] = 0;     ans = 0;     for (i = 1; i <= n; ++i) {       for (j = l; j >= 1; --j)         if (i != 1 && (a[i - 1] & ((1 << j) - 1)) == (a[i] >> l - j)) break;       minn = 1 << 30;       for (k = 0; k <= l; ++k)         Min(minn, f[(a[i] >> l - k) | (1 << k)] + l - k + ans);       ans += l - j;       if (i != 1)         for (k = 0; k <= l; ++k)           Min(f[(a[i - 1] & ((1 << k) - 1)) | (1 << k)], minn - ans);     }     minn = 1 << 30;     for (i = 0; i < 1 << l + 1; ++i) Min(minn, f[i]);     printf( %d n , minn + ans);   }   