func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, s, k;   int arr[51];   char color[51];   int mem[51][2501];   int solve(int i, char last, int num, int sum) {     if (sum >= k) {       return 0;     }     if (~mem[i][sum]) return mem[i][sum];     int ch1 = 1e9;     for (int j = 0; j < n; j++) {       if (arr[j] > num && last != color[j])         ch1 = min(ch1, solve(j, color[j], arr[j], sum + arr[j]) + abs(i - j));     }     return mem[i][sum] = ch1;   }   int main() {     ios_base::sync_with_stdio(0);     cout.tie(0);     cin.tie(0);     srand(time(NULL));     cin >> n >> s >> k;     for (int i = 0; i < n; i++) cin >> arr[i];     for (int i = 0; i < n; i++) {       cin >> color[i];     }     memset(mem, -1, sizeof mem);     int ans = 1e9;     for (int i = 0; i < n; i++) {       ans = min(solve(i, color[i], arr[i], arr[i]) + abs(s - 1 - i), ans);     }     if (ans != 1e9)       cout << ans <<   n ;     else       cout << -1 <<   n ;   }   