#25 - Find Duplicate Numbers

You are given an array of integers. Some of the elements in the array are duplicates, and there can be multiple duplicate numbers. Your task is to implement a function to find and return all duplicate numbers present in the array.

Example 1

Input

[1, 3, 4, 2, 2, 3, 5, 6, 1]

Output

[1,3,2]

Example 2

Input

[4, 3, 2, 7, 8, 2, 3, 1]

Output

[3,2]

Last updated