Open palayutm opened 6 years ago
void reorder(vector<int>& a) { for (int i = 1; i < a.size(); i++) { if ((i & 1) ^ (a[i] >= a[i - 1])) { swap(a[i], a[i - 1]); } } }
这波精简的我服
好好好你们短你们短
Question_ID: Q004
Language: c++
Time Cost: 40-mins
Time Complexity: O(n)
Solution
My Code
Other