Write a function with the following specifications:
Definition of Duplicate:
Any integer that appears more than once in the input array.
Goal:
Identify and return all such duplicate integers from the given array.
Step 1: Created an empty object count to store occurrences of each number.
Step 2: Iterated over the array and populate count with the frequency of each number.
Step 3: Iterated through count, and if a number appears more than once, add it to the duplicates array.
Step 4: Converted object keys to numbers and return the duplicates array.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?