My solution is accepted on CodeChef
import fileinputdef votersList():IDCounter = {};for line in fileinput.input():if not(fileinput.isfirstline()):key = int(line)IDCounter[key] = IDCounter.get(key,0) + 1IDCounter = [str(id) for id,count in sorted(IDCounter.items()) if count > 1]return IDCounter;IDCounter = votersList()print(str(len(IDCounter))+"\n"+"\n".join(IDCounter),end='')
Read more… (6 words)