#C8546. Find the Missing Number
Find the Missing Number
Find the Missing Number
You are given a list of unique integers that contains all the numbers from 1 to n except one. Your task is to find the missing number.
The expected sum of numbers from 1 to \(n\) is given by the formula: \(S = \frac{n(n+1)}{2}\), where \(n = m+1\) and \(m\) is the number of integers provided.
Read the input from standard input and output the missing number to standard output.
inputFormat
The first line of input contains an integer m indicating the number of integers provided. The second line contains m space-separated integers, which are all the numbers from 1 to m+1 except one.
outputFormat
Output a single integer, which is the missing number in the sequence.
## sample7
3 7 1 2 8 4 5
6