C++ .  this problem is  so easy that I code it fluently with no change
\n\nclass Solution {\npublic:\n    vector<int> sortArrayByParityII(vector<int>& A) {\n        \n        for(int i=0,j=1;j<A.size();){\n            if(A[i]%2 == 
```\n\nclass Solution {\npublic:\n    vector<int> sortArrayByParityII(vector<int>& A) {\n        \n        for(int i=0,j=1;j<A.size();){\n            if(A[i]%2 == 1 && A[j]%2 == 0){\n                swap(A[i],A[j]);\n                i=i+2;\n                j=j+2;\n            }else if(A[i]%2 == 0 && A[j]%2 == 0){\n                i=i+2;\n            }else if(A[i]%2 == 1 && A[j]%2 == 1){\n                j=j+2;\n            }else{\n                i=i+2;\n                j=j+2;\n            }\n        }\n        return A;\n    }\n};\n\n```
[]