def aa(nums): if not nums: return False hashes={} ret=[] for s in nums: hashes[s]=hashes[s]+1 if hashes.get(s) else 1 if hashes[s] >1: ret.append(s) return list(set(ret)) print(aa([1,2,3,4,4,2,2,3]))
def aa(nums): if not nums: return False hashes={} ret=[] for s in nums: hashes[s]=hashes[s]+1 if hashes.get(s) else 1 if hashes[s] >1: ret.append(s) return list(set(ret)) print(aa([1,2,3,4,4,2,2,3]))