C++ Solution:Two pointer,Using bitwise operator
If the Solution helps you,please do consider upvoting it.\n\nclass Solution {\npublic:\n    vector<int> sortArrayByParityII(vector<int>& nums) \n    {\n      fo
**If the Solution helps you,please do consider upvoting it.**\n```\nclass Solution {\npublic:\n    vector<int> sortArrayByParityII(vector<int>& nums) \n    {\n      for(int i=0,j=1;i<nums.size() and j<nums.size();)\n      {\n          if(!(nums[i]&1))\n              i+=2;\n          else if(nums[j]&1)\n              j+=2;\n          else\n              swap(nums[i],nums[j]);\n      }\n        return nums;\n    }\n};\n```
['Two Pointers', 'C', 'C++']