题解 | #调整数组顺序使奇数位于偶数前面(一)#
调整数组顺序使奇数位于偶数前面(一)
http://www.nowcoder.com/practice/ef1f53ef31ca408cada5093c8780f44b
class Solution:
def reOrderArray(self , array: List[int]) -> List[int]:
j = []
o = []
for i in array:
if i % 2 == 0:
o.append(i)
else:
j.append(i)
return j + o