Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Non-unique Elements by agtorre
#Your optional code here
#You can import some modules or create additional functions
from collections import defaultdict
def checkio(data):
unique_count = defaultdict(int)
#iterate once to build the dictionary
for d in data:
unique_count[d] += 1
#iterate again to check against the dictionary
result = [d for d in data if unique_count[d] > 1]
return result
April 26, 2014