func_code_string: #include <bits/stdc++.h>   using namespace std;   char s[100500];   char c[200100];   int l[100100][26], r[100100][26];   int last[26];   int main() {     long long res;     int tmp;     int n, k, ll, l1, i, j;     cin >> n >> k;     scanf( %s , s);     ll = strlen(s);     memset(last, -1, sizeof(last));     for (i = 0; i < ll; i++) {       last[s[i] -  a ] = i;       for (j = 0; j < 26; j++) l[i][j] = last[j];     }     memset(last, -1, sizeof(last));     for (i = ll - 1; i >= 0; i--) {       last[s[i] -  a ] = i;       for (j = 0; j < 26; j++) r[i][j] = last[j];     }     for (int cnt = 0; cnt < n; cnt++) {       scanf( %s , c);       l1 = strlen(c);       res = 0;       for (j = 0; j < l1; j++) {         tmp = 100500;         if (l[min(j, ll - 1)][c[j] -  a ] != -1)           tmp = abs(j - l[min(j, ll - 1)][c[j] -  a ]);         if (r[min(j, ll - 1)][c[j] -  a ] != -1)           tmp = min(tmp, abs(r[min(j, ll - 1)][c[j] -  a ] - j));         if (tmp == 100500) tmp = l1;         res += tmp;       }       cout << res << endl;     }   }   