Answers for "python find the duplicate number"

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
1

python check for duplicate

def checkDuplicate(user):
    if len(set(user)) < len(user):
        return True
    return False
Posted by: Guest on November-20-2020

Code answers related to "python find the duplicate number"

Python Answers by Framework

Browse Popular Code Answers by Language