Median of sorted array

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];
}

}

Hi @abhijitbarua8181
I have corrected ur code… its passing all test cases now…
corrected code --> https://ide.codingblocks.com/s/640673

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.