送分题
class Solution(object): def sortArrayByParityII(self, A): """ :type A: List[int] :rtype: List[int] """ ans=[] size=len(A) odd,even=[],[] for a in A: if a%2==0: even.append(a) else: odd.append(a) for i in range(size): if i%2==0: ans.append(even.pop()) else: ans.append(odd.pop()) return ans