#C2515. Find the Missing Number
Find the Missing Number
Find the Missing Number
Given an unsorted list of distinct integers representing a sequence of numbers from 1 to \( n+1 \) with exactly one number missing, your task is to find the missing number.
The sequence should ideally sum to \( S = \frac{n(n+1)}{2} \) where \( n = \text{length of the list} + 1 \). Given the list, compute the actual sum and determine the missing number by subtracting the actual sum from the expected sum.
If the input list is empty, the missing number is 1.
inputFormat
The input is given via stdin as a space-separated list of integers in a single line. If the list is empty, the input will be an empty string.
outputFormat
Output a single integer via stdout which is the missing number.
## sample1 2 4 5 6
3