Duplicated number
Time limit2sMemory limit256 MB
A size-N array contains 1..N-1 with one value M repeated; find M.
- Level
Easy3 of 10
- Topics
- Math
- Solved
- No attempts yet
Problem
A sequence holds every integer from to exactly once, in no particular order. One more integer with is put into it, which makes a sequence of size . Given , write a program that finds .
Input
The first line contains the size of the sequence ().
The second line contains the elements of , separated by spaces. Every element is an integer between and , and all of them are distinct except the answer .
Output
Print on the first line.