Missing Number
Time: 1 s
Memory: 500 MB
Memory: 500 MB
You are given all integers from 1 to n except one. Your task is to find and print the missing number.
Input
The first line contains a single integer n, the total count of numbers.The second line contains n − 1 distinct integers, each between 1 and n (inclusive).
Constraint
\(2≤n≤2×10^5\)
Output
Print the missing number.
Examples
| Input | Output |
|---|---|
|
5
5 2 1 3 |
4
|
Problem Info
| Problem ID | 658 |
| Time Limit | 1000 ms |
| Memory Limit | 512000 KB |
| Moderators | utpalbarua |
Statistics
Submit
You need to Login or Registration for submit your solution