Answers for "find the first duplicate in an array in python easy code"

1

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
Posted by: Guest on March-09-2020

Code answers related to "find the first duplicate in an array in python easy code"

Python Answers by Framework

Browse Popular Code Answers by Language