Available question text
Given an array of length n with values in [1,n] where each value appears once or twice, return all values that appear twice in O(n) time and O(1) extra space. The core challenge is to detect duplicates by using the input array itself as bookkeeping (mapping values to indices) rather than extra data structures.
Related questions
Continue with questions that share topics or the same question type.
- Find All K-Distant Indices in an Array
Coding
- Find All Lonely Numbers in the Array
Coding · Array · Counting · Hash Table
- Find All Numbers Disappeared in an Array
Coding
- Find Score of an Array After Marking All Elements
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 442. Find All Duplicates in an Array
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source