Python3 easy to understand solution
class Solution:\n    def sortArrayByParityII(self, A: List[int]) -> List[int]:\n\t\n        op=[0]*len(A)\n        e=0\n        o=1\n        for i in A:\n      
class Solution:\n    def sortArrayByParityII(self, A: List[int]) -> List[int]:\n\t\n        op=[0]*len(A)\n        e=0\n        o=1\n        for i in A:\n            if i%2==0:\n                op[e]=i\n                e+=2\n            else:\n                op[o]=i\n                o+=2\n        return op\n
['Python', 'Python3']