I want to insert the substring into the main string after sorting the main string. How can I do that??
Like,
ilovecoding
after sorting cdegiilnoov
. And after that let say substring eco
, it should be inserted as decogiilnov
.
#include <bits/stdc++.h>
using namespace std;
int main(){
int tc;
string s,a;
cin>>tc;
while(tc--){
cin>>s>>a;
sort(s.begin(), s.end());
cout<<s<<endl;
}
return 0;
}
I got stuck here, also tried many times, till here I think everything is correct...