清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
# -*- coding:utf-8 -*- class Solution: def MoreThanHalfNum_Solution(self, numbers): nlist = set(numbers) nlen = len(numbers) for item in nlist: if numbers.count(item) > (nlen/2.0): return item else: return 0
2015/12/02 39128
清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
# -*- coding:utf-8 -*- class Solution: def MoreThanHalfNum_Solution(self, numbers): nlist = set(numbers) nlen = len(numbers) for item in nlist: if numbers.count(item) > (nlen/2.0): return item else: return 0