62. Missing and Repeating
MediumArrayMath
The array has n numbers from 1..n where exactly one number appears twice and one number is missing. Print the repeating number and the missing number.
Input format
Line 1: n Line 2: n integers
Output format
repeating missing
Example 1
Input
5 3 1 2 5 3
Output
3 4
Example 2
Input
2 2 2
Output
2 1
Constraints
2 ≤ n ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 6 test cases, most of them hidden.
Loading the MyLoginn IDE…