[c++] easy and fast
Please upvote my solution if you like it\n\n\'\'\'\nclass Solution {\npublic:\n\n    vector sortArrayByParityII(vector& A) {\n        int n=A.size();\n        v
**Please upvote my solution if you like it**\n\n\'\'\'\nclass Solution {\npublic:\n\n    vector<int> sortArrayByParityII(vector<int>& A) {\n        int n=A.size();\n        vector<int>ans(n);\n        int ec=0,oc=1;\n        for(int i=0;i<n;i++)\n        {\n            if(A[i]%2==0)\n            {\n                ans[ec]=A[i];\n                ec+=2;\n            }\n            else\n            {\n                ans[oc]=A[i];\n                oc+=2;\n            }\n        }\n        return ans;\n    }\n};\n\'\'\'
['Two Pointers', 'C', 'C++']