题解 | #调整数组顺序使奇数位于偶数前面#
调整数组顺序使奇数位于偶数前面
https://www.nowcoder.com/practice/beb5aa231adc45b2a5dcc5b62c93f593
# # # @param array int整型一维数组 # @return int整型一维数组 # class Solution: def reOrderArray(self , array ): # write code here res = [] for i in array: if i % 2 ==1: res.append(i) for j in array: if j % 2 == 0: res.append(j) return res