Simple cpp sol without Swap


#1

vector Solution::wave(vector &A) {
sort(A.begin(),A.end());
for(int i=0;i<A.size()-1;i+=2){
int b= A[i];
A[i]=A[i+1];
A[i+1]=b;
}
return A;
}