Find the Duplicate Number
Medium
Arrays
An array of n + 1 integers contains values in the range [1, n] and exactly one value is repeated (possibly more than twice). Print the repeated value without modifying the array and using O(1) extra space.
Constraints
2 <= m <= 10^5 + 1 1 <= nums[i] <= m - 1
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.