C++ 1 line using sort function
\n\n\n    vector sortArrayByParity(vector& A) {\n        sort(A.begin(),A.end(),{return (a1%2)<(a2%2); });\n            return A;\n    }\n\n
\n\n\n    vector<int> sortArrayByParity(vector<int>& A) {\n        sort(A.begin(),A.end(),[](int &a1,int &a2){return (a1%2)<(a2%2); });\n            return A;\n    }\n\n
['C', 'Sorting']