题解 | 数组遍历记录次数
数组中只出现一次的两个数字
http://www.nowcoder.com/practice/389fc1c3d3be4479a154f63f495abff8
不用哈希表、位运算,数组遍历记录次数,时间与内存均很小
class Solution: def FindNumsAppearOnce(self , array ): list1 = [] for i in range(len(array)): array1 = array[:] array1.pop(i) if array[i] not in array1: list1.append(array[i]) list1.sort() return list1