Back to Questions

Find All Duplicates in an Array

64.6K viewsAsked at Meta
Medium

Question Explain

Given an array of integers, where $1 \leq a[i] \leq n$, some elements appear twice and others appear once. Find all the elements that appear twice. Solve without extra space and in $O(n)$ runtime.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question
Find All Duplicates in an Array - Interview Question