0961. N-Repeated Element in Size 2N Array
https://leetcode.com/problems/n-repeated-element-in-size-2n-array
Description
You are given an integer array nums
with the following properties:
nums.length == 2 * n
.nums
containsn + 1
unique elements.Exactly one element of
nums
is repeatedn
times.
Return the element that is repeated n
times.
Example 1:
Example 2:
Example 3:
Constraints:
2 <= n <= 5000
nums.length == 2 * n
0 <= nums[i] <= 104
nums
containsn + 1
unique elements and one of them is repeated exactlyn
times.
ac
Last updated