func_code_string: #include <bits/stdc++.h>   using namespace std;   int higherR(int candies[], int index, int n, int c) {     int counter = 0;     for (int i = index + 1; i < n; i++) {       if (candies[i] > candies[index] && candies[i] != c) {         counter++;       }     }     return counter;   }   int higherL(int candies[], int index, int n, int c) {     int counter = 0;     for (int i = index - 1; i >= 0; i--) {       if (candies[i] > candies[index] && candies[i] != c) {         counter++;       }     }     return counter;   }   int main() {     int n;     cin >> n;     int l[n], r[n];     for (int i = 0; i < n; i++) {       cin >> l[i];     }     for (int i = 0; i < n; i++) {       cin >> r[i];     }     int candies[n];     for (int i = 0; i < n; i++) {       candies[i] = -1;     }     int currentNumberOfCandies = n - 1;     int childrenFed = 0;     bool contradiction = true;     for (int i = 0; i < n; i++) {       if (l[i] == 0 && r[i] == 0) {         candies[i] = n;         ++childrenFed;         contradiction = false;       }     }     if (contradiction) {       cout <<  NO ;       return 0;     }     while (childrenFed < n) {       if (currentNumberOfCandies < 1) {         cout <<  NO ;         return 0;       }       for (int i = 0; i < n; i++) {         if (candies[i] != -1) {           continue;         }         if (higherL(candies, i, n, currentNumberOfCandies) > l[i] ||             higherR(candies, i, n, currentNumberOfCandies) > r[i]) {           cout <<  NO ;           return 0;         }         if (higherL(candies, i, n, currentNumberOfCandies) == l[i] &&             higherR(candies, i, n, currentNumberOfCandies) == r[i]) {           candies[i] = currentNumberOfCandies;           ++childrenFed;         }       }       --currentNumberOfCandies;     }     cout <<  YES  << endl;     for (int i = 0; i < n; i++) {       cout << candies[i] <<    ;     }     return 0;   }   