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