Simplest C++ sol


#1

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