Practice Interview Questions
| Question | Status |
|---|---|
Given an array of integers, your task is to find all the duplicate numbers in the array and return them in the order they first appear as duplicates. An integer is considered a duplicate if it appears more than once in the array.
Example:
Input: [1, 3, 4, 2, 2, 3, 5, 6]
Output: [2, 3]
Explanation: In the array [1, 3, 4, 2, 2, 3, 5, 6], the number 2 appears twice and the number 3 also appears twice. These numbers should be returned as the output.