Sushi Conveyor Belt Saga: The Missing Plate!

View as PDF

Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

You and your foodie friend Mike love visiting your favorite sushi conveyor belt restaurant. The plates, numbered from 1 to N+1, move past in order. But just as you reach out to grab your favorite plate, Mike snatches it first!

Now, you're left wondering which plate is missing from the sequence. Can you figure it out?

Input

  • An integer N+1 — the total number of plates initially.
  • A line with N space-separated integers — the remaining plates on the conveyor belt.

Output

Output a single integer — the missing plate number that Mike grabbed.

Constraints

  • 1 \leq N \leq 10^5
  • The input will always be a valid sequence with exactly one missing plate.

Example 1

Input
5
1 2 4 5
Output
3

Example 2

Input
6
2 3 1 5 6
Output
4

Comments

There are no comments at the moment.