Missing Runner

Interview

Time limit1sMemory limit256 MB

Summary
Given the numbers 1 to N with exactly one omitted from a list of N - 1 distinct values, report the missing number.
Level

Easy1 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

You are organizing a marathon with N runners. Each runner is given a distinct number from 1 to N so they can be easily identified.

You record the number of each runner as they cross the finish line. Unfortunately, you notice that only N − 1 runners have finished. Which runner is still out there?

Input

The first line of input contains the integer N. (1 ≤ N ≤ 215) The next line contains N − 1 distinct integers in the range from 1 to N, representing the numbers of the runners who have crossed the finish line.

Output

Output the number of the runner who has not crossed the finish line.

Examples1

  1. Example 1

    Input
    5
    1 5 2 3
    
    Expected output
    4