class Solution:
    def reOrderArray(self , array ):
        # write code here
        # 类似于冒泡排序
        length = len(array)
        for i in range(length):
            for j in range(1, length - i):
                if not array[j - 1] & 1 and array[j] & 1:  # 前一个为偶数且后一个为奇数时才交换
                    array[j - 1], array[j] = array[j], array[j - 1]
                    
        return array