DNA AND RNA IBM problem solution

// Online C++ compiler to run C++ program online
#include <bits/stdc++.h>
using namespace std;
string solve(string &s , unordered_map<string , char>map1)
    {
        char p;
        if(s.substr(0 , 3) == "000")
        {
            p= 'd';
        }
        else
        {
            p = 'r';
        }
        string result = "";
        for(int i = 3 ; i < s.length(); i+=3)
        {  
            char x = map1[s.substr(i , 3)];
            if(p == 'd')
            {
              if(x == 'U')
              result.push_back('T');
              else
              result.push_back(x);
            }
            else
            {
                if(x == 'T')
              result.push_back('U');
              else
              result.push_back(x);
               
               
            }
           
        }
        return result;
       
    }
       
    void solve(string s )
    {
        return;
    }
int main() {
   
    unordered_map<string, char>map1 = {
        {"001", 'C'} ,
        {"010", 'G'},
        {"011", 'A'},
        {"101" , 'T'},
        {"110", 'U'}
       
    };
   
    string s = "111001010110101011010101001";
    // cout << s.length() << "\n";
    string p = solve(s , map1);
    cout << p << "\n";
    return 0;
}

Comments