Submit | All submissions | Best solutions | Back to list |
FNDMSNG - Find the missing number |
You are given a permutation (a sequence of N distinct integers between 1 and N) but exactly one integer is missing! Can you find this element?
Input
First line of the standard input contains a single integer N (2 <= N <= 100)
The second line contains N−1 integers. A permutation with one integer missing. All integers are between 1 and N and all of them are distinct.
Output
Output a single integer – the missing number from the permutation.
Example
Input: 10 10 2 3 1 9 7 8 6 4 Output: 5
Added by: | fuad71 |
Date: | 2022-06-20 |
Time limit: | 1s |
Source limit: | 50000B |
Languages: | All |
Resource: | https://codeforces.com/group/yg7WhsFsAp/contest/355504/problem/P51 |