Skip to content

Commit f8f4c33

Browse files
authored
Merge pull request #456 from SanketKN/master
Create SanketKN_missing_number.py
2 parents aed0d5c + 5ad4e0a commit f8f4c33

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#Missing Number
2+
#You are given all numbers between 1,2,…,n except one.
3+
#Your task is to find the missing number.
4+
#problem link: https://cses.fi/problemset/task/1083
5+
#user id: SanketKN
6+
#cses user link: https://cses.fi/user/33432
7+
8+
x = int(input())
9+
n = list(map(int,input().split()))[:x-1]
10+
y = (x*(x+1)//2)-sum(n)
11+
print(y)

0 commit comments

Comments
 (0)