func_code_string: #include <bits/stdc++.h>   using namespace std;   string s;   int m, ch[1002];   int gt(int bal, int prv, int st) {     if (st == m) return ch[st] = 11;     if (bal <= 0) {       for (int i = 1; i <= 10; i++) {         if (i != prv && s[i] ==  1  && bal + i > 0) {           int t = gt(bal + i, i, st + 1);           if (t) return ch[st] = i;         }       }       return 0;     }     for (int i = 1; i <= 10; i++) {       if (i != prv && s[i] ==  1  && bal - i < 0) {         int t = gt(bal - i, i, st + 1);         if (t) return ch[st] = i;       }     }     return 0;   }   int main() {     memset(ch, -1, sizeof(ch));     cin >> s >> m;     s =     + s;     int to = gt(0, 0, 0);     if (ch[0] == -1)       cout <<  NO ;     else {       int k = 0;       cout <<  YES n ;       while (k < m) {         cout << ch[k] <<    ;         k++;       }     }     return 0;   }   