Find All Duplicates in an Array
An array of n integers has values in the range [1, n] and each value appears once or twice. Print every value that appears twice, in ascending order, using O(1) extra space.
Constraints
1 <= n <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.