Interview Shuriken 55: Missing Numbers

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.

Input Format:
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
Output Format:
The first and only line of output contains elements that are not found in the array. 
Sample Input 1:
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

Popular posts from this blog

How to pass parameters in webhook?

Access and modify all the resources of our Wiki.js using WikiJS API

Fahrenheit to Celsius