class Solution:
    def repeatedNTimes(self, A):
        doubleN = len(A)
        N = doubleN / 2
        dic = {}
        for a in A:
            if a in dic.keys():
                dic[a]=dic[a]+1
            else:
                dic[a]=1
            if dic[a]==N:
                return a

 

posted on 2018-12-23 16:22  Sempron2800+  阅读(115)  评论(0编辑  收藏  举报