func_code_string: #include <bits/stdc++.h>   using namespace std;   long long n, k, i, j, a[2 * 100010];   vector<char> ans;   int main() {     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> a[i];     }     long long l = 1, r = n, f = -1e18;     while (l <= r) {       if (f >= a[l] && f >= a[r]) break;       if (a[l] <= f && f < a[r]) {         ans.push_back( R );         f = a[r];         r--;         continue;       }       if (a[l] > f && f >= a[r]) {         ans.push_back( L );         f = a[l];         l++;         continue;       }       if (a[l] < a[r]) {         ans.push_back( L );         f = a[l];         l++;       } else {         if (a[l] > a[r]) {           ans.push_back( R );           f = a[r];           r--;         } else {           int k1 = 0, k2 = 0;           for (int j = l + 1; j <= r; j++) {             if (a[j] > a[j - 1])               k1++;             else               break;           }           for (int j = r - 1; j >= l; j--) {             if (a[j] > a[j + 1])               k2++;             else               break;           }           if (k1 > k2) {             ans.push_back( L );             for (int j = l + 1; j <= r; j++) {               if (a[j] > a[j - 1])                 ans.push_back( L );               else                 break;             }           } else {             ans.push_back( R );             for (int j = r - 1; j >= l; j--) {               if (a[j] > a[j + 1])                 ans.push_back( R );               else                 break;             }           }           break;         }       }     }     cout << ans.size() <<   n ;     for (int i = 0; i < ans.size(); i++) {       cout << ans[i];     }   }   