simple c++  / python solution
C++\n\n\nclass Solution {\npublic:\n    vector<int> sortArrayByParity(vector<int>& nums) {\n        int left = 0;\n        int right = nums.size() - 1;\n       
**C++**\n\n```\nclass Solution {\npublic:\n    vector<int> sortArrayByParity(vector<int>& nums) {\n        int left = 0;\n        int right = nums.size() - 1;\n        int i = 0;\n        \n        while(left < right)\n        {\n            if(nums[i] % 2)\n            {\n                swap(nums[i], nums[right]);\n                --right;\n            }\n            else\n            {\n                ++i;\n                ++left;\n            }\n        }\n        return nums;\n    }\n};\n```\n\n**Python**\n\n```\nclass Solution:\n    def sortArrayByParity(self, nums: List[int]) -> List[int]:\n        left = 0\n        right = len(nums) - 1\n\n        while left < right:\n            if nums[i] % 2 :\n                nums[i], nums[right] = nums[right], nums[i]\n                right -= 1 \n                \n            else:\n                i += 1\n                left += 1\n\n        return nums\n```\n
['C', 'Python', 'Python3']