Missing Number in the Array Coding Question — Asked in Qualcomm Interview Rounds.

Placewit
Mar 29, 2022

Problem Statement :

Given an array of size N-1 such that it only contains distinct integers in the range of 1 to N. Find the missing element.

Input Format:

The first line of the input contains the value of N.

The second line contains a list of numbers from 1 to N-1.

Output Format:

The output contains one line of elements not present in the sequence of numbers between 1 and N-1.

Given:

10
6 1 2 8 3 4 7 10 5

Output:

9

Code:

Thanks for Reading

Placewit grows the best engineers by providing an interactive classroom experience and by helping them develop their skills and get placed in amazing companies.

Learn more at Placewit. Follow us on Instagram and Facebook for daily learning.

--

--