func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, k;     cin >> n >> k;     string s;     cin >> s;     char a, b;     a = s[0];     b = s[s.length() - 1];     int j = s.length() - 2;     int i = 0;     int maxcount = 0;     while (j - i >= 0) {       int k1 = j - i;       int k = s[k1];       int q1 = s.length() - 1;       int q = s[q1];       int count = 0;       while (k1 > 0 && q == k) {         count++;         q1--;         q = s[q1];         k1--;         k = s[k1];       }       if (q == k) {         count++;       } else {         k1 = -1;       }       if (maxcount < count && k1 == 0) {         maxcount = count;       }       i++;     }     string x = s.substr(0, s.length() - maxcount);     string y = s.substr(s.length() - maxcount, s.length());     for (int i = 0; i < k; i++) {       cout << x;     }     cout << y;     return 0;   }   