β Yet Another Array Rearrangement Problem (Contest)
Yet Another Array Rearrangement Problem (Contest) easy Time Limit: 2 sec Memory Limit: 128000 kB
```cpp
#include <bits/stdc++.h> // header file includes every Standard library
using namespace std;
#define int long long
signed main() {
// Your code here
int n;
cin >>n;
vector<int>a(n);
for(auto &i:a) {
cin >> i;
}
int odd=0;
for(auto i:a)
{
if(i%2)odd++;
}
if(odd!=0 and odd !=n){
sort(a.begin(),a.end());
}
for(auto i:a) cout<<i<< ' ';
}
```Last updated