Given an unsorted array of integers of size n, having elements ranging from 1 to n (number of elements). The array may have repetitive elements, hence some numbers in the range are missing from the array. Find and print those numbers.
The first line of input contains an integer,
that denotes the value of n.
The following line contains n space separated integers,
that denote the array elements.
Constraints:
1 <= number of elements, element values <= 10,000,000
Time Limit: 1 second
The first and only line of output contains elements that are not found in the array.
7
4 2 7 1 1 3 7
Sample Output 1:
5 6
Explanation:
Missing numbers between range of 1 to 7 are 5 and 6.
Comments
Post a Comment
Please give us your valuable feedback