Missing Integers

 Coding Problem Keys 

 Missing Integers 

 Problem Statement 

The program must accept an integer N in a continuous series and print the missing integer values. The first and last terms in the series will always be present.

 Boundary Condition(s) 

2 <= N <= 100
1 <= Each integer value <= 1000

 Input Format 

The first line contains the value of N.
The second line contains N integers separated by a space.

 Output Format 

The first line contains the missing integer values separated by a space.

 Example Input/Output 1 

 Input 

5
10 12 15 16 20

 Output 

11 13 14 17 18 19

 Example Input/Output 2 

 Input 

8
1 5 6 7 8 9 11 12

 Output 

2 3 4 10

 Note: Max Execution Time Limit: 500 millisecs 

 Solution 

 Programming Language: Python 3 Language 

n=int(input())
l=list(map(int,input().split()))
for i in range(l[0],l[-1]):
    if i not in l:
        print(i,end=" ")

# Published By PKJCODERS

 (Note: Incase If the code doesn't Pass the output kindly comment us with your feedback to help us improvise.) 

Comments

Popular Posts

Property Inheritance in Family

Reversed Sum of Pairs

Sort Rows by Prime, Even and Odd Count

String Comparision

Bit Party

Integer - Alphabet Pairs to Matrix