# -*- coding:utf-8 -*- class Solution: def reOrderArray(self, array): # write code here result1 = [] result2 = [] for i in array: if i%2 == 1: result1.append(i) else: result2.append(i) return result1 + result2
时间复杂度应该是o(n)
# -*- coding:utf-8 -*- class Solution: def reOrderArray(self, array): # write code here result1 = [] result2 = [] for i in array: if i%2 == 1: result1.append(i) else: result2.append(i) return result1 + result2
时间复杂度应该是o(n)