func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n;     string s;     cin >> n >> s;     queue<int> q;     int cntD = 0, cntR = 0;     for (int i = 0; i < n; i++) {       if (s[i] ==  R )         cntR++;       else         cntD++;       q.push(i);     }     int removeD = 0, removeR = 0;     while (!q.empty()) {       if (cntD - removeD <= 0) {         cout <<  R ;         return 0;       }       if (cntR - removeR <= 0) {         cout <<  D ;         return 0;       }       int top = q.front();       q.pop();       if (s[top] ==  R ) {         if (removeR) {           removeR--;           cntR--;         } else {           removeD++;           q.push(top);         }       } else {         if (removeD) {           removeD--;           cntD--;         } else {           removeR++;           q.push(top);         }       }     }     return 0;   }   