Find the Duplicate
Medium · rating 1400 · Arrays, Hashing
The first line has n. The second line has n+1 integers, each in 1..n, with exactly one value repeated. Print the repeated value.
Constraints: 1 ≤ n ≤ 105
Related problems
- Count Pairs With Difference — Medium
- Count Pairs with Sum — Medium
- Count Pairs With Sum — Medium
- Most Common Value — Medium
- Two Sum Exists — Medium
- Most Frequent Element — Medium