Leetcode 905. Sort Array By Parity

class Solution(object):
    def sortArrayByParity(self, A):
        return [x for x in A if x % 2 == 0] + [x for x in A if x % 2 == 1]
原文地址:https://www.cnblogs.com/zywscq/p/10674657.html