2 pointer solution||easy||dryrun||explanation||O(n)
\n1st  take a pointer s=0;\nthan we check num[i] is even \nif even than swap the and increase \nthe s=s+1;\n\n\n\n```\nclass Solution {\npublic:\n    vector sor
\n1st  take a pointer s=0;\nthan we check num[i] is even \nif even than swap the and increase \nthe s=s+1;\n![image](https://assets.leetcode.com/users/images/5dc9039c-a05d-4d43-8cf4-8b8ecadef812_1651458157.9378617.jpeg)\n\n\n```\nclass Solution {\npublic:\n    vector<int> sortArrayByParity(vector<int>& nums) {\n       int s = 0;\n        int n = nums.size();\n       for(int i=0;i<n;i++)\n       {\n           if(nums[i]%2==0)\n               swap(nums[s++],nums[i]);\n       }\n        return nums;\n    }\n};\n\nTime complexcity O(n)\nSpace complexcity O(1)\n
['C', 'C++']