BEST SOLUTION!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Intuition\nMake need even numbers at start and followed by odd numbers.\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nWe are usin
# Intuition\nMake need even numbers at start and followed by odd numbers.\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nWe are using two pointer method.\nStart i on index 0 and j on index array size minus 1.\nIf ith element is odd and jth element is even, swap the numbers.\nIf ith element is even, ignore because it is correct in its place.\nIf jth element is odd, ignore because it is in its correct place.\nReturn the vector.\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> sortArrayByParity(vector<int>& nums) {\n        int n = nums.size();\n        int i=0;\n        int j=n-1;\n        while(i<j) {\n            if(nums[i]%2!=0 && nums[j]%2==0) {\n                swap(nums[i], nums[j]);\n                i++;\n                j--;\n            }\n            if(nums[i]%2==0)\n                i++;\n            if(nums[j]%2!=0)\n                j--;\n        }\n        return nums;\n\n    }\n};\n```
['Array', 'Two Pointers', 'Sorting', 'Iterator', 'C++']