python two pointers one pass
one pointer is used to remember the odd position, the other is to remember the even position\n\nclass Solution:\n    def sortArrayByParityII(self, A):\n        
one pointer is used to remember the odd position, the other is to remember the even position\n```\nclass Solution:\n    def sortArrayByParityII(self, A):\n        """\n        :type A: List[int]\n        :rtype: List[int]\n        """\n        odd = 1\n        even = 0\n        result = [0]*len(A)\n        for num in A:\n            if num%2==0:\n                result[even] = num\n                even += 2\n            else:\n                result[odd] = num\n                odd += 2\n        return result\n```
[]