func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 2e5 + 5;   int cnt[maxn][26];   int dif[26];   int getAns() {     int cc = 0;     for (int i = 0; i < 26; ++i)       if (dif[i]) {         ++cc;       }     return cc;   }   int main() {     string s;     cin >> s;     int len = s.length();     for (int i = 1; i <= len; ++i) {       for (int k = 0; k < 26; ++k) cnt[i][k] = cnt[i - 1][k];       ++cnt[i][s[i - 1] -  a ];     }     int q;     cin >> q;     while (q--) {       int l, r;       cin >> l >> r;       --l;       for (int i = 0; i < 26; ++i) dif[i] = cnt[r][i] - cnt[l][i];       int tot = getAns();       if (tot == 1) {         if (r - l == 1)           cout <<  YES  << endl;         else           cout <<  NO  << endl;       } else if (tot == 2) {         if (s[l] != s[r - 1])           cout <<  YES  << endl;         else           cout <<  NO  << endl;       } else {         cout <<  YES  << endl;       }     }   }   