Open KIRA96855 opened 3 years ago
vector
sort(v.begin(), v.end());
int t,n,k=1;
// int n=floor(v.size()/2);
vector
for(int i=0;i<n-1;i+=2){ t=i+1; if(k%2!=0) { c.insert(c.begin(),v[i]); c.insert(c.begin(),v[t]); //c.push_back(v[t]); //c.push_back(v[i]);
} else { c.push_back(v[i]); c.push_back(v[t]); } k++;
} if(v.size()%2!=0) { c.insert(c.begin(),v[n]); } return c;
i need your help in gfg c++ stl contest 2 second question the pendulum swings how can i contact you