Dsa
Hashing
Warm-up
Find All Duplicates
Given a list of numbers (where each number can only appear once or twice), find all the numbers that appear twice and return them in a list.
Input Format:
- A single line containing space-separated integers.
Output Format:
- Print the numbers that appear twice as a space-separated string.
Example:
Input:
"4 3 2 7 8 2 3 1"
Output:
"3 2"
Key concepts
hashingarrays
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now