python 简单遍历
数组中出现次数超过一半的数字
http://www.nowcoder.com/questionTerminal/e8a1b01a2df14cb2b228b30ee6a92163
有两种情况,要么存在要么不存在
class Solution: def MoreThanHalfNum_Solution(self, numbers): # write code here if len(numbers) == 1: return numbers[0] num = None for i in numbers: if i == num: return i num = i return 0