Messy Kevin IV
Kevin from the IT team has not been doing a very good job. He'd messed up syncing the server logs, he'd messed up analysing the log messages, and he couldn't index the files in the servers either. He'd messed it up every single time! If he is always struggling to complete his tasks, then is it worth keeping him around?
Your boss decided to give him one last chance. Kevin's job was now on the line.
Kevin's task was to find the missing integer in a list of integers from to
inclusive. He had to do this in
time complexity and with
space complexity. Even if he got the solution, if he didn't follow these rules, he wouldn't be deemed fit for the job.
Your boss has also given you this task, and tells you that he'll give you a raise if you solve it before Kevin does. You've been cleaning up Kevin's mess every time, and it's time you got rewarded for it!
Input
The first line contains an integer
, the maximum value of an integer in the list.
The next line contains unique integers, with values ranging between
and
inclusive. This means that there is one integer missing in this list.
Output
Output the missing integer in the list.
Example
Input 1
4
3 2 4
Output 1
1
The missing number in the list of integers between and
inclusive is
.
Input 2
8
3 7 6 8 1 4 2
Output 2
5
Comments