Solution in Python 3 (beats 100%) (two-pointer) ( Space: O(1) )
```\nclass Solution:\n    def sortArrayByParityII(self, A: List[int]) -> List[int]:\n    \tj = 1\n    \tfor i in range(0,len(A),2):\n    \t\tif A[i] % 2 == 0: c
```\nclass Solution:\n    def sortArrayByParityII(self, A: List[int]) -> List[int]:\n    \tj = 1\n    \tfor i in range(0,len(A),2):\n    \t\tif A[i] % 2 == 0: continue\n    \t\twhile A[j] % 2 != 0: j += 2\n    \t\tA[i], A[j] = A[j], A[i]\n    \treturn A\n\t\t\n\t\t\n- Junaid Mansuri
['Two Pointers']