Cpp || Two pointer || In-Place 🔥🔥🔥
\nclass Solution {\npublic:\n    vector<int> sortArrayByParityII(vector<int>& nums) {\n        \n        int odd = 1; // pointer at odd index\n        int even 
```\nclass Solution {\npublic:\n    vector<int> sortArrayByParityII(vector<int>& nums) {\n        \n        int odd = 1; // pointer at odd index\n        int even = 0; //pointer at even index \n        \n        while(even<nums.size()){\n            if(nums[even] % 2 == 0){ // if even place has even value \n                even += 2; // increment even pointer\n            }\n            else{ // else even place has odd value\n                swap(nums[even], nums[odd]); // swap values such that odd pointer will surely have odd value\n                odd += 2; // increment odd pointer\n            }\n        }\n        return nums; // return your in-place solution \n    }\n};\n```
[]