Python, Just Swap O(1) Space O(N) Time, easy to Understand
Just Swap and move Pointers\n\n\nclass Solution:\n    def sortArrayByParity(self, nums: List[int]) -> List[int]:\n        i = 0\n        j = len(nums)-1\n      
Just Swap and move Pointers\n\n```\nclass Solution:\n    def sortArrayByParity(self, nums: List[int]) -> List[int]:\n        i = 0\n        j = len(nums)-1\n        while i<j:\n            if nums[i]%2 != 0 and nums[j]%2 == 0:\n                nums[i], nums[j] = nums[j], nums[i]\n                i+=1\n                j-=1\n            elif nums[i]%2 == 0:\n                i+=1\n            elif nums[j]%2 != 0:\n                j-=1\n        return nums\n```
['Python']