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

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.

--

--

--

Upskilling students for tech placements!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Perform Multitasking in Flask and Tornado

Magic, PHP, or Javascript? A Little of Each

How to choose the right Nearshore Software Development Company?

Take 5 minutes to better understand the “You have one or more certificates in your Salesforce org…

How to enjoy tripling money in Hyperion’s Sandbox?

Apache Hop, environments and configurations. A better setup.

Linux terminals are boring. Here’s how I made it awesome with Oh My Zsh

Ninja And Fibonacci Numbers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Placewit

Placewit

Upskilling students for tech placements!

More from Medium

Chessboard and Dominos Puzzle

Leetcode 462. Minimum Moves to Equal Array Elements II

7/5 leet code

733. Flood Fill