PythonMediumAlgorithms

Find Duplicate Numbers

Write a function that takes a list of numbers and returns a list of all numbers that appear more than once. Each duplicate should appear only once in the result.

Starter code

Python
def find_duplicates(numbers):
    # Your code here
    pass

# Test
print(find_duplicates([1, 2, 3, 2, 4, 3, 5]))  # Should print: [2, 3]

Stuck on this challenge?

Let CodeForge AI help you find the solution.