func_code_string: #include <bits/stdc++.h>   using namespace std;   long long int gcd(long long int a, long long int b) {     return (!b) ? a : gcd(b, a % b);   }   int n, k;   void solve() {     cin >> n >> k;     string s;     cin >> s;     vector<vector<int>> mvs;     int mxs = 0;     int cnt = 0;     while (cnt <= n) {       vector<int> cr;       for (int i = 0; i <= (int)s.size() - 2; i++) {         if (s[i] ==  R  && s[i + 1] ==  L ) {           cr.push_back(i);           s[i] =  L ;           s[i + 1] =  R ;           i += 1;         }       }       if ((int)cr.size() == 0) break;       mvs.push_back(cr);       mxs += (int)cr.size();       cnt += 1;     }     if (k >= (int)mvs.size() && k <= mxs) {       int rem = (int)mvs.size();       for (auto fv : mvs) {         vector<int> cv = fv;         int i = 0;         while (i < (int)cv.size()) {           int ch = 1;           if (rem == k) ch = (int)cv.size() - i;           cout << ch <<    ;           for (int j = 0; j < ch; j++) {             cout << cv[i] + 1 <<    ;             i += 1;           }           cout <<   n ;           k -= 1;         }         rem -= 1;       }     } else {       cout << -1;     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     solve();   }   