I’m not able to find the median . I did rest of the part of sorting the vector and inserting the element
check the code below:-
#include
#include
#include
using namespace std;
int main() {
int n;
cin>>n;
vectorv;
for(int i=0;i<n;i++){
int no;
cin>>no;
v.push_back(no);
}
for(int i=0;i<n;i++){
int np;
cin>>np;
v.push_back(np);
}
std::sort(v.begin(),v.end());
int g=v.size();
for(int i=0;i<g;i++){
if(g%2==0)
cout<<v[g/2-1]<<v[g/2];
else
cout<<v[g/2];
}
}