Program to identify missing Numbers in a given Array

l1=list(map(int,input().split()))
l=len(l1)+1
s1=l*(l+1)//2
print(s1-sum(l1))


Input: 1 2 3 5 6 
 
Output 4

No comments:

Post a Comment