python get the first element in duplicate code example
Example: python find first duplicate numbers
def findDuplicateNumbers(a):
mySet = set()
for el in a:
if el in mySet:
return el
mySet.add(el)
return -1
def findDuplicateNumbers(a):
mySet = set()
for el in a:
if el in mySet:
return el
mySet.add(el)
return -1